build docker compose

This commit is contained in:
root
2020-09-29 05:24:15 +00:00
parent 4cc6e69e10
commit 9b34f8d8ab
6 changed files with 43 additions and 3 deletions

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ fet2020/*/migrations/*
migrate
run
*.pid
*~

View File

@@ -20,7 +20,7 @@ COPY --from=builder /opt/venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
COPY ./fet2020 /app
COPY --chown nginx ./fet2020 /app
COPY ./deployment/nginx.conf /etc/nginx/conf.d/fet2020.conf
#RUN python manage.py makemigrations && python manage.py makemigrations posts members

1
build_docker Executable file
View File

@@ -0,0 +1 @@
docker build -t fet2020django .

View File

@@ -5,6 +5,21 @@ server {
alias /app/static;
try_files $uri $uri/ =404;
}
location /fotos {
proxy_ssl_server_name on;
proxy_ssl_verify off;
proxy_pass http://flaskfetfotos:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
# proxy_set_header REMOTE-USER $http_REMOTE_USER;
# proxy_set_header X-Forwarded-User $http_REMOTE_USER;
# proxy_set_header x-forwarded-user $http_REMOTE_USER;
proxy_set_header Connection "upgrade";
}
location / {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;

23
docker-compose.yml Normal file
View File

@@ -0,0 +1,23 @@
version: "3"
services:
flaskfetfotos:
image: flask-fet-fotos
ports:
- "8080:8080"
environment:
FLASK_DEBUG: 1
FLASK_APP: main.py
pages_root: /app/data
mysql:
image: jbergstroem/mariadb-alpine
environment:
# SKIP_INNODB: no
MYSQL_DATABASE: fet2020db
MYSQL_USER: user
MYSQL_PASSWORD: hgu
fet2020:
image: fet2020django
ports:
- "8001:8080"
volumes:
- ./fet2020:/app

View File

@@ -43,7 +43,7 @@ SECRET_KEY = 'r37-i7l)vrduzz2-gira+z#u!p!di9#f+%s*5-bb($hg)55@ns'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['uat1.2020.fet.at', '127.0.0.1']
DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024
# Application definition