-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·74 lines (66 loc) · 1.65 KB
/
docker-compose.yml
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
version: "3.9" # Specify the Docker Compose version (recommended: 3.8 or higher)
services:
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3.13.1
networks:
- main
ports:
- "5672:5672"
restart: always
postgres:
container_name: postgres
image: postgres:16
networks:
- main
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data # Corrected typo: 'data' instead of 'date'
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=blog23 # Corrected typo: 'user' instead of 'user'
- POSTGRES_PASSWORD=0440101069mhfd29
celery_worker:
container_name: celery_worker
command: "celery -A blog23 worker -l INFO"
depends_on:
- app
- rabbitmq
- postgres
environment:
- C_FORCE_ROOT: "true" # Corrected typo: 'C_FORCE_ROOT' instead of 'C_FORCE_ROOT'
restart: always
build: .
networks:
- main
app:
build: .
container_name: app
command: sh -c "python manage.py migrate && gunicorn blog23.wsgi -b 0.0.0.0:8000" # Corrected: use 0.0.0.0 for internal access
volumes:
- .:/code/
restart: always
networks:
- main
expose:
- "8000" # Expose port for internal Docker network access
depends_on:
- postgres
nginx:
container_name: nginx
image: nginx:1.25.4
command: nginx -g 'daemon off;'
ports:
- "80:80" # Corrected: map port 80 of the host to port 80 of the container
networks:
- main
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- app
networks:
main:
volumes:
postgres_data: