Skip to content

Commit 3f11927

Browse files
authored
Create Dockerfile
Docker file to build image. Contains main.py, dependencies like g++, nginx, numpy. Copies main file, nginx config file, and output file to working directory. nginx is kept running in the foreground and listens to port 80 on localhost. Once running, it will display contents of output file on localhost:80.
1 parent 4eb8c52 commit 3f11927

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

docker/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.9-alpine
2+
3+
ADD main.py .
4+
RUN apk add --no-cache g++ nginx
5+
RUN pip install numpy
6+
COPY main.py /app/
7+
COPY output.txt /app/output.txt
8+
COPY nginx.conf /etc/nginx/nginx.conf
9+
CMD sh -c "python ./main.py &" && nginx -g 'daemon off;'

0 commit comments

Comments
 (0)