-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.certbot.yml
More file actions
111 lines (107 loc) · 3.24 KB
/
Copy pathdocker-compose.certbot.yml
File metadata and controls
111 lines (107 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '3.8'
services:
foxeye_db:
build:
context: ./postgres
dockerfile: Dockerfile.prod
# image: postgres:14-alpine
container_name: postgres14_foxeye
ports:
- 5430:5432 # доступ к БД извне по порту 5430
restart: always
volumes:
- postgres_volume:/var/lib/postgresql/data
# - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
- POSTGRES_DB=foxeye_db
- POSTGRES_USER=django
- POSTGRES_PASSWORD=kw2RdBYa
backend:
build:
context: ./backend
dockerfile: Dockerfile.prod
container_name: backend_prod
restart: always
# extra_hosts:
# - "host.docker.internal:host-gateway"
working_dir: /backend
command: >
sh -c "
echo pwd && pwd &&
echo ls && ls &&
cd backend &&
python manage.py makemigrations &&
python manage.py migrate --noinput &&
gunicorn --bind 0.0.0.0:8000 --workers 4 backend.wsgi:application
"
# python manage.py collectstatic --noinput &&
volumes:
- .:/backend
ports:
- 8000:8000
env_file:
- backend/.env.prod
environment:
- POSTGRES_HOST=foxeye_db
- POSTGRES_NAME=foxeye_db
- POSTGRES_USER=django
- POSTGRES_PASSWORD=kw2RdBYa
# для работы с командой python manage.py createsuperuser --noinput
# https://docs.djangoproject.com/en/4.1/ref/django-admin/#django-admin-createsuperuser
# не подходит, так как каждый раз сбрасывает пароль
# - DJANGO_SUPERUSER_USERNAME=admin
# - DJANGO_SUPERUSER_PASSWORD=adminpass
# - DJANGO_SUPERUSER_EMAIL="admin@admin.com"
# - DEBUG=0
# - SECRET_KEY="django-insecure-63-b9e&kzla8vd)k=5)mc5z$ji&e&o$^+873s)r)^06s!s0^42"
# - ALLOWED_HOSTS="localhost, 127.0.0.1, 0.0.0.0, 158.160.0.127"
depends_on:
- foxeye_db
# - backend-init
#backend-init: # вариант сделать заполнение БД тестовыми данными через этап сборки контейнера
# command: python manage.py migrate --noinput
# volumes:
# - .:/backend
# depends_on:
# - db
nginx:
container_name: nginx_prod
restart: unless-stopped
# expose:
# - 8000
ports:
- 80:80
- 443:443
# - 8000:8000
volumes:
- ./backend/static:/static
- ./backend/media:/media
- vue_dist:/dist
# - ./nginx:/etc/nginx/conf.d
# - ./nginx/foxeye.prod.conf:/etc/nginx/conf.d/default.conf
# - ./data/certbot/conf:/etc/letsencrypt
# - ./data/certbot/www:/var/www/certbot
build:
context: ./nginx
dockerfile: Dockerfile
environment:
- RUN_CERTBOT=true
- CERTBOT_DOMAINS=foxhound-team.pro,www.foxhound-team.pro
- CERTBOT_EMAIL=nk260an@gmail.com
depends_on:
- backend
# - frontend
command: >
sh -c "
certbot --nginx
--email nk260an@gmail.com
--domains foxhound-team.pro,www.foxhound-team.pro
--agree-tos --redirect --reinstall --non-interactive
-v
"
volumes:
postgres_volume:
static_volume:
vue_dist:
pgadmin_volume:
nginx_volume: