flaskapp/Dockerfile

21 lines
470 B
Docker
Raw Normal View History

2023-09-12 15:31:09 +10:00
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder
WORKDIR /app
COPY requirements.txt /app
RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install -r requirements.txt
COPY . /app
# Set the timezone during the container build
RUN apk --update add tzdata && \
cp /usr/share/zoneinfo/Australia/Sydney /etc/localtime && \
echo "Australia/Sydney" > /etc/timezone
EXPOSE 5000
ENTRYPOINT ["python3"]
CMD ["server.py"]
FROM builder as dev-envs