build docker compose
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -9,4 +9,5 @@ fet2020/*/migrations/*
|
||||
.flake8
|
||||
migrate
|
||||
run
|
||||
*.pid
|
||||
*.pid
|
||||
*~
|
||||
@@ -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
1
build_docker
Executable file
@@ -0,0 +1 @@
|
||||
docker build -t fet2020django .
|
||||
@@ -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
23
docker-compose.yml
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user