Skip to content

Commit

Permalink
ビルド高速化施策
Browse files Browse the repository at this point in the history
  • Loading branch information
na2na-p committed Nov 27, 2023
1 parent 41b3977 commit f48503b
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions infra/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
ARG NODE_VERSION=20.9.0-bookworm
ARG DEBIAN_VERSION=bookworm-20231120-slim

FROM debian:${DEBIAN_VERSION} AS base

ARG PYTHON_VERSION=3.11.6
FROM node:${NODE_VERSION} AS builder

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
&& apt-get update \
&& apt-get install -yqq --no-install-recommends \
build-essential \
ca-certificates \
libssl-dev \
zlib1g-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libgdbm-dev \
libdb5.3-dev \
libbz2-dev \
libexpat1-dev \
liblzma-dev \
tk-dev \
libffi-dev \
wget

RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar -xzf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure --enable-optimizations \
&& make -j 8 \
&& make altinstall \
&& cd .. \
&& rm -rf Python-${PYTHON_VERSION}.tgz Python-${PYTHON_VERSION} \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*

FROM node:${NODE_VERSION} as builder

COPY --from=base /usr/local /usr/local
python3

RUN corepack enable

Expand Down

0 comments on commit f48503b

Please sign in to comment.