10884-dockerify #6

Merged
mravi merged 14 commits from 10884-dockerify into master 2022-09-19 08:27:32 +00:00
3 changed files with 53 additions and 0 deletions
Showing only changes of commit f960c4e779 - Show all commits

34
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,34 @@
version: '3.8'
services:
web:
build:
context: ./
dockerfile: Dockerfile.prod
command: gunicorn gmba_django.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/app/app/staticfiles
expose:
- 8000
env_file:
- ./.env.prod
depends_on:
- db
db:
image: postgres:13.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
nginx:
build: ./nginx
volumes:
- static_volume:/home/app/app/staticfiles
ports:
- 1337:80
depends_on:
- web
volumes:
postgres_data:
static_volume:

4
nginx/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM nginx:1.21-alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d

15
nginx/nginx.conf Normal file
View File

@ -0,0 +1,15 @@
upstream gmba_django {
server 127.0.0.1:8000;
}
server {
listen 80;
location / {
proxy_pass http://gmba_django;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}