Skip to content

Commit bb38754

Browse files
Merge pull request #14 from daniel-learns-with-coursera/add-docker
Added docker support
2 parents c0fd01e + 031cae0 commit bb38754

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.9-slim
2+
3+
# Create working folder and install dependencies
4+
WORKDIR /app
5+
COPY requirements.txt .
6+
RUN pip install --no-cache-dir -r requirements.txt
7+
8+
# Copy the application contents
9+
COPY service/ ./service/
10+
11+
# Switch to a non-root user
12+
RUN useradd --uid 1000 theia && chown -R theia /app
13+
USER theia
14+
15+
# Run the service
16+
EXPOSE 8080
17+
CMD ["gunicorn", "--bind=0.0.0.0:8080", "--log-level=info", "service:app"]

0 commit comments

Comments
 (0)