-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (24 loc) · 761 Bytes
/
Dockerfile
File metadata and controls
29 lines (24 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
##################################################
# Create production image
##################################################
# cSpell: disable
FROM quay.io/rofrano/python:3.12-slim
# Set up the Python production environment
WORKDIR /app
COPY Pipfile Pipfile.lock ./
RUN python -m pip install --upgrade pip pipenv && \
pipenv install --system --deploy
# Copy the application contents
COPY wsgi.py .
COPY service ./service
# Switch to a non-root user and set file ownership
RUN useradd --uid 1001 flask && \
chown -R flask:flask /app
USER flask
# Expose any ports the app is expecting in the environment
ENV FLASK_APP=wsgi:app
ENV PORT=8080
EXPOSE $PORT
ENV GUNICORN_BIND=0.0.0.0:$PORT
ENTRYPOINT ["gunicorn"]
CMD ["--log-level=info", "wsgi:app"]