mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
init (#120)
Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
This commit is contained in:
parent
a42a8531ab
commit
4480b64e58
10 changed files with 313 additions and 0 deletions
32
nginx-wsgi-flask/flask/Dockerfile
Normal file
32
nginx-wsgi-flask/flask/Dockerfile
Normal file
|
@ -0,0 +1,32 @@
|
|||
FROM python:3.9.2-alpine
|
||||
|
||||
# upgrade pip
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
# get curl for healthchecks
|
||||
RUN apk add curl
|
||||
|
||||
# permissions and nonroot user for tightened security
|
||||
RUN adduser -D nonroot
|
||||
RUN mkdir /home/app/ && chown -R nonroot:nonroot /home/app
|
||||
RUN mkdir -p /var/log/flask-app && touch /var/log/flask-app/flask-app.err.log && touch /var/log/flask-app/flask-app.out.log
|
||||
RUN chown -R nonroot:nonroot /var/log/flask-app
|
||||
WORKDIR /home/app
|
||||
USER nonroot
|
||||
|
||||
# copy all the files to the container
|
||||
COPY --chown=nonroot:nonroot . .
|
||||
|
||||
# venv
|
||||
ENV VIRTUAL_ENV=/home/app/venv
|
||||
|
||||
# python setup
|
||||
RUN python -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
RUN export FLASK_APP=app.py
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# define the port number the container should expose
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["python", "app.py"]
|
Loading…
Add table
Add a link
Reference in a new issue