Skip to content

Commit

Permalink
Build release images
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 committed Sep 9, 2024
1 parent 4c6d423 commit 06d9953
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1,413 deletions.
32 changes: 21 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
FROM python:3.12-slim
FROM python:3.12-slim AS builder

LABEL maintainer="Henry Zhu <[email protected]>"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \
apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

COPY requirements.txt .
RUN python -m pip install --upgrade pip
RUN python -m pip install --upgrade libsass

# libsass requires some features introduced by the recent C++ standard.
# You need a C++ compiler that support those features.
RUN apt-get update \
&& apt-get install -y gcc g++ libffi-dev \
&& pip install --no-cache-dir -r requirements.txt \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y --auto-remove gcc g++ libffi-dev
FROM python:3.12-slim AS release
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
ARG VERSION

LABEL maintainer="Henry Zhu <[email protected]>"
RUN python -m pip install --upgrade pip

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
WORKDIR /app
COPY start.sh .
COPY beaverhabits ./beaverhabits
CMD ["sh", "start.sh", "prd"]
Loading

0 comments on commit 06d9953

Please sign in to comment.