Skip to content

Commit 72db5d2

Browse files
committed
Added Docker support
1 parent d8e10e3 commit 72db5d2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.11-slim
2+
3+
# Establish a working folder
4+
WORKDIR /app
5+
6+
# Establish dependencies
7+
COPY pyproject.toml poetry.lock ./
8+
RUN python -m pip install poetry && \
9+
poetry config virtualenvs.create false && \
10+
poetry install --without dev
11+
12+
# Copy source files last because they change the most
13+
COPY wsgi.py .
14+
COPY service ./service
15+
16+
# Become non-root user
17+
RUN useradd -m -r service && \
18+
chown -R service:service /app
19+
USER service
20+
21+
# Run the service on port 8080
22+
EXPOSE 8080
23+
CMD ["gunicorn", "wsgi:app", "--bind", "0.0.0.0:8080"]

0 commit comments

Comments
 (0)