-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
104 lines (94 loc) · 2.36 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
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
version: '3'
services:
redis:
restart: always
container_name: redis
image: redis:alpine
command: redis-server --save 20 1 --loglevel warning --requirepass "password"
volumes:
- redis-data:/data
ports:
- "6379:6379"
networks:
- learning-network
mongo_db:
image: mongo:6.0
container_name: mongo-db
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=password
- MONGO_INITDB_DATABASE=learning-db
ports:
- "27017:27017"
volumes:
- db:/data/db
networks:
- learning-network
server:
restart: always
container_name: learning-microservice-backend
image: learning-microservice-backend:latest
build:
context: .
dockerfile: server/docker/Dockerfile
# command: bash -c "/usr/src/app/flatter-backend/entrypoint.sh && daphne -b 0.0.0.0 -p 8000 backend.asgi:application"
environment:
DB_URI: mongodb://mongo-db:27017
# DJANGO_ENV: ${DJANGO_ENV}
# DJANGO_ADMIN_USER: ${DJANGO_ADMIN_USER}
# DJANGO_ADMIN_EMAIL: ${DJANGO_ADMIN_EMAIL}
# DJANGO_ADMIN_PASSWORD: ${DJANGO_ADMIN_PASSWORD}
# SECRET_KEY: ${SECRET_KEY}
# DB_ENGINE: ${DB_ENGINE}
# DB_DATABASE: ${DB_DATABASE}
# DB_USER: ${DB_USER}
# DB_PASSWORD: ${DB_PASSWORD}
# DB_HOST: ${DB_HOST}
# volumes:
# - static:/usr/src/app/flatter-backend/static
# - static:/usr/src/app/flatter-backend/media
expose:
- 8000
depends_on:
- mongo_db
- redis
links:
- redis
env_file:
- .env
networks:
- learning-network
nginx:
restart: always
container_name: learning-microservice-nginx
image: learning-microservice-nginx:latest
build:
context: ./nginx
dockerfile: ./Dockerfile
# volumes:
# - static:/usr/src/app/flatter-backend/static
# - static:/usr/src/app/flatter-backend/media
ports:
- 80:80
depends_on:
- server
- mongo_db
networks:
- learning-network
# volumes:
# static:
# name: flatter-static
# redis-data:
# name: flatter-redis-data
volumes:
db:
name: learning-microservice-db
redis-data:
name: learning-microservice-redis-data
networks:
learning-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.5.0.0/16