website/Dockerfile

31 lines
738 B
Docker
Raw Normal View History

2025-12-23 00:44:08 +01:00
# ----------------------------
# Build stage
# ----------------------------
FROM python:3.11.0-alpine AS builder
RUN apk add --no-cache \
2025-12-23 01:42:46 +01:00
git
2025-12-23 00:44:08 +01:00
ENV POETRY_VERSION=2.2.0
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION" # --break-system-packages is not needed
ENV POETRY_VIRTUALENVS_CREATE=false
ENV POETRY_NO_INTERACTION=1
WORKDIR /app
RUN git clone https://git.stefan.works/stefan/website.git .
2025-12-23 01:42:46 +01:00
RUN poetry install --only main # --no-root
RUN poetry run python -m scripts.patch_flask_frozen
2025-12-23 00:44:08 +01:00
RUN poetry run python freezer.py
# ----------------------------
# Runtime stage
# ----------------------------
2025-12-23 01:42:46 +01:00
FROM nginx:alpine
2025-12-23 00:44:08 +01:00
COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]