Add docker support
This commit is contained in:
19
deploy/Dockerfile
Normal file
19
deploy/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM python:3.8
|
||||
|
||||
RUN groupadd user
|
||||
RUN useradd -m -d /home/user -s /bin/bash -g user -m user
|
||||
|
||||
WORKDIR /home/user
|
||||
COPY deploy/requirements.txt /tmp/
|
||||
RUN pip install -r /tmp/requirements.txt
|
||||
|
||||
USER user:user
|
||||
|
||||
RUN mkdir -p ~/data/files
|
||||
RUN touch ~/data/myapp.log
|
||||
|
||||
COPY --chown=user:user . ./
|
||||
|
||||
# EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "-w", "4", "--bind=0.0.0.0", "myapp:app"]
|
||||
10
deploy/nginx/app.conf
Normal file
10
deploy/nginx/app.conf
Normal file
@@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
access_log /var/log/nginx/myapp-access.log;
|
||||
error_log /var/log/nginx/myapp-error.log;
|
||||
location / {
|
||||
include proxy_params;
|
||||
proxy_pass http://app:8000/;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name myapp www.myapp;
|
||||
access_log /var/log/nginx/myapp-access.log mainproxy;
|
||||
error_log /var/log/nginx/myapp-error.log info;
|
||||
location / {
|
||||
include uwsgi_params;
|
||||
uwsgi_pass unix:///run/uwsgi/myapp.sock;
|
||||
}
|
||||
}
|
||||
3
deploy/nginx/proxy_params
Normal file
3
deploy/nginx/proxy_params
Normal file
@@ -0,0 +1,3 @@
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -1,6 +1,8 @@
|
||||
wtforms
|
||||
flask
|
||||
sqlalchemy
|
||||
sqlalchemy-utils
|
||||
alembic
|
||||
celery
|
||||
Flask==1.1.2
|
||||
Flask-JSONRPC==1.1.0
|
||||
alembic==1.4.2
|
||||
SQLAlchemy==1.3.17
|
||||
SQLAlchemy-Utils==0.36.6
|
||||
flake8==3.8.3
|
||||
gunicorn==20.0.4
|
||||
psycopg2-binary==2.8.5
|
||||
|
||||
Reference in New Issue
Block a user