-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose-development.yml
151 lines (140 loc) · 4.14 KB
/
docker-compose-development.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "3.8"
# This could be seen as both advantage / disadvantage of having all container share the same env.
x-environment:
&dev-environment
- STAGE=development
# REDIS DB
- REDIS_HOST=jasma-redis-db
- REDIS_PORT=6379
# NEXTJS frontend
- NEXTJS_HOST=jasma-client
- NEXTJS_PORT=3000
# Paypal
- PAYPAL_SECRET=""
- PAYPAL_CLIENT_ID_SANDBOX=""
- PAYPAL_CLIENT_ID_PRODUCTION=""
- STRIPE_SECRET_KEY=""
services:
# POSTGRES
jasma-pg-db:
container_name: jasma-pg-db-dev
image: postgres:14-alpine # I think we can afford to go with lastest major version (TBD)
restart: always
environment: *dev-environment
env_file:
- .env/.local/.postgres/.env
expose:
- 5432
ports:
- "6432:5432" # For people that run postgres on their linux machine :)
networks:
- jasma-network-dev
volumes:
- jasma-storage-dev:/var/lib/postgresql/data #Check that this works
- ./compose/local/postgresql:/docker-entrypoint-initdb.d # Init script for database
# REDIS
jasma-redis-db:
container_name: jasma-redis-db-dev
image: redis:7-alpine # I think we can afford to go with lastest major version (TBD)
restart: always
command: redis-server --save 20 1 --loglevel warning
expose:
- 6379
ports:
- "6379:6379"
networks:
- jasma-network-dev
volumes:
- jasma-storage-dev:/redis-data
# DJANGO backend
jasma-api-server:
image: jasma-api-server-dev
container_name: jasma-api-server-dev
build:
context: .
dockerfile: compose/local/django/Dockerfile
# target: development # This will be unused for now
environment: *dev-environment
env_file:
- .env/.local/.django/.env
- .env/.local/.django/.secrets.env
- .env/.local/.postgres/.env
restart: always
expose:
- 8000
ports:
- "8000:8000"
networks:
- jasma-network-dev
depends_on:
- jasma-pg-db
- jasma-redis-db
volumes:
- ./backend:/backend:z # This allows for realtime changes to be effective
# NEXTJS frontend website
jasma-client:
container_name: jasma-client-dev
build:
context: .
dockerfile: compose/local/next/Dockerfile
target: development
args:
- BASE_URL=http://localhost
- PORT=3000
- NEXT_PUBLIC_API_SERVER_URL=localhost
- NEXT_PUBLIC_API_SERVER_PORT=8000
- NEXT_PUBLIC_NODE_ENV=development
- ANALYZE=false
- SESSION_SECRET=thisisatemporarysecret
- NEXT_TELEMETRY_DEBUG=1
- NEXT_TELEMETRY_DISABLED=1
environment: *dev-environment
env_file:
- .env/.local/.nextjs/.env
restart: always
image: jasma-client-dev
volumes:
- ./frontend:/client
- /client/node_modules
- /client/.next
expose:
- 3000
ports:
- "3000:3000"
networks:
- jasma-network-dev
depends_on:
- jasma-api-server
# NGINX reverse-proxy load balancing webserver
jasma-nginx-dev:
container_name: jasma-nginx-dev
build:
context: ./nginx
target: development
restart: always
ports:
- "80:80"
networks:
- jasma-network-dev
# NGINX RTMP SERVER
jasma_live:
restart: always
build:
context: ./rtmp
target: development
expose:
- 5050
- 1935
ports:
- "1935:1935"
- "5050:5050"
networks:
- jasma-network-dev
user: root
container_name: jasma_live
volumes:
jasma-storage-dev:
driver: local
networks:
jasma-network-dev:
driver: bridge