-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yaml
69 lines (68 loc) · 1.88 KB
/
docker-compose-dev.yaml
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
services:
certgen:
image: nginx:latest
volumes:
- ./certs:/etc/ssl/certs
command: >
/bin/sh -c "
if [ ! -f /etc/ssl/certs/localhost.crt ]; then
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/certs/localhost.key -out /etc/ssl/certs/localhost.crt -subj '/CN=localhost/O=Localhost/C=US' && echo 'Certificates ready.' || echo 'Error making certificate request';
else
echo 'Certificates already exist.';
fi"
nginx:
container_name: cmmc-dev-nginx
image: nginx:latest
ports:
- "3001:3001"
volumes:
- ./nginx/dev:/etc/nginx/conf.d
- ./certs:/etc/ssl/certs:ro
- ./nginx/docker-entrypoint.sh:/docker-entrypoint.sh
command: ["/docker-entrypoint.sh"]
environment:
- PROJECT_URL=${PROJECT_URL}
depends_on:
- certgen
- backend
- frontend
backend:
container_name: cmmc-dev-backend
build:
context: ./backend
dockerfile: Dockerfile.dev
volumes:
- ./backend:/app
- ./backend/media:/app/media
environment:
- DJANGO_DATABASE_URL=mysql://cmmcmapdev:${MARIADB_PASSWORD}@db/cmmcmap
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
- DJANGO_ROOT_PASSWORD=${DJANGO_ROOT_PASSWORD}
- DJANGO_ALLOWED_HOSTS=*
- PROJECT_URL=${PROJECT_URL}
depends_on:
- db
frontend:
container_name: cmmc-dev-frontend
build:
context: ./frontend
dockerfile: Dockerfile.dev
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- "3000:3000"
db:
container_name: cmmc-dev-db
image: mariadb
volumes:
- dev_mariadb_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MYSQL_DATABASE=cmmcmap
- MYSQL_USER=cmmcmapdev
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
ports:
- "3306:3306"
volumes:
dev_mariadb_data: