mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 05:09:49 -06:00
nginx research results, no way this works
This commit is contained in:
32
Dockerfile
32
Dockerfile
@@ -1,13 +1,29 @@
|
||||
FROM docker.io/python:3.8-buster
|
||||
# nginx-gunicorn-flask
|
||||
|
||||
FROM ubuntu:12.04
|
||||
LABEL maintainer="Andrew Simonson <asimonson1125@gmail.com>"
|
||||
|
||||
WORKDIR /app
|
||||
ADD ./src /app
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
COPY . .
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y python python-pip python-virtualenv nginx gunicorn supervisor
|
||||
# do we really need venv?
|
||||
|
||||
RUN apt-get -yq update && \
|
||||
pip install --no-cache-dir -r ./src/requirements.txt
|
||||
WORKDIR /app/src
|
||||
# Setup flask application
|
||||
RUN mkdir /deploy/app
|
||||
COPY src /deploy/app
|
||||
RUN pip install -r /deploy/app/requirements.txt
|
||||
|
||||
CMD [ "gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|
||||
# Setup nginx
|
||||
RUN rm /etc/nginx/sites-enabled/default
|
||||
COPY flask.conf /etc/nginx/sites-available/
|
||||
RUN ln -s /etc/nginx/sites-available/flask.conf /etc/nginx/sites-enabled/flask.conf
|
||||
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
|
||||
|
||||
# Setup supervisord
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
|
||||
|
||||
# Start processes (Lol idk how this works)
|
||||
CMD ["/usr/bin/supervisord"]
|
||||
|
||||
Reference in New Issue
Block a user