Skip to content

Commit 77ecad1

Browse files
author
Iliyan Vutoff
committed
Add Dockerfile to create the Python app Docker image
1 parent 6421c64 commit 77ecad1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
python3 \
6+
python3-pip \
7+
&& mkdir -p /app \
8+
&& useradd -d /app -s /bin/bash app \
9+
&& chown -R app:app /app
10+
11+
COPY requirements.txt /app/requirements.txt
12+
RUN pip3 install -r /app/requirements.txt
13+
14+
COPY app/app.py /app
15+
WORKDIR /app
16+
17+
USER app
18+
19+
CMD ["python3", "app.py"]

0 commit comments

Comments
 (0)