File tree Expand file tree Collapse file tree 3 files changed +35
-14
lines changed
Expand file tree Collapse file tree 3 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 1- FROM alpine :3.7
1+ FROM python :3.9-alpine3.15
22
3- MAINTAINER Prashant Shahi "coolboi567@gmail.com "
3+ LABEL MAINTAINER " Prashant Shahi <me@prashantshahi.dev> "
44
5- COPY . /app
5+ RUN pip install --upgrade pip
66
7- WORKDIR /app
7+ RUN adduser -D appuser
8+ USER appuser
9+ WORKDIR /home/appuser
810
9- RUN apk add --no-cache bash git nginx uwsgi uwsgi-python py2-pip \
10- && pip2 install --upgrade pip \
11- && pip2 install -r requirements.txt \
12- && rm -rf /var/cache/apk/*
11+ ENV PATH="/home/appuser/.local/bin:${PATH}"
1312
14- EXPOSE 5000
13+ COPY --chown=appuser:appuser requirements.txt requirements.txt
14+ RUN pip install --user -r requirements.txt
15+
16+ COPY --chown=appuser:appuser . .
1517
1618ENTRYPOINT ["python" ]
1719
18- CMD ["app.py" ]
20+ CMD ["app.py" ]
Original file line number Diff line number Diff line change 1+ FROM --platform=$BUILDPLATFORM python:3.9-alpine3.15
2+
3+ LABEL MAINTAINER "Prashant Shahi <me@prashantshahi.dev>"
4+
5+ RUN pip install --upgrade pip
6+
7+ RUN adduser -D appuser
8+ USER appuser
9+ WORKDIR /home/appuser
10+
11+ ENV PATH="/home/appuser/.local/bin:${PATH}"
12+
13+ COPY --chown=appuser:appuser requirements.txt requirements.txt
14+ RUN pip install --user -r requirements.txt
15+
16+ COPY --chown=appuser:appuser . .
17+
18+ ENTRYPOINT ["python"]
19+
20+ CMD ["app.py"]
Original file line number Diff line number Diff line change 11version : " 3.3"
22services :
33 flaskapp :
4- build : .
5- image : my-flaskapp
4+ image : coolboi567/todo-flaskapp:${DOCKER_TAG:-latest}
65 ports :
76 - 5000:5000
87 container_name : flask-app
98 environment :
109 - APP_ENV=development
11- - PORT=80
10+ - PORT=5000
1211 - MONGO_HOST=mongo
1312 - MONGO_PORT=27017
1413 networks :
1514 - my-net
1615 depends_on :
1716 - mongo
1817 mongo :
19- image : mvertes/alpine-mongo
18+ image : mvertes/alpine-mongo:latest
2019 ports :
2120 - 27017:27017
2221 networks :
You can’t perform that action at this time.
0 commit comments