-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
40 lines (39 loc) · 1.44 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
version: '3.7'
services:
db:
image: mariadb # Tells Compose to use the 'mariadb' image for the 'db' service
environment:
MYSQL_DATABASE: 'django' #name of the auto-created database
MYSQL_USER: 'mrdc' #This user getssuperuser privileges on the django database created above
MYSQL_PASSWORD: 'apricots' #password for MRDC user
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- db:/var/lib/mysql # Connects /var/lib/mysql in the container to a named Docker volume
web:
build: ./django # Tells Compose to build the 'web' service from ./django (with Dockerfile)
volumes:
- ./django:/code # Connects ./django in this repo to /code inside the web container
- static:/static
- media:/media
depends_on:
- db # Tells Compose that 'db' needs to be started before 'web' can start
command: "uvicorn composeexample.asgi:application --host 0.0.0.0 --reload" #Overrides the Dockerfile, so we can reload during Dev
redis:
image: 'redis:latest' # tells compose to use the official redis image
nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- static:/data/static
- media:/data/media
environment:
- NGINX_HOST=localhost
- NGINX_PORT=80
ports:
- "8000:80"
depends_on:
- web
volumes:
db:
static:
media: