-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
49 lines (46 loc) · 1.14 KB
/
docker-compose.yaml
File metadata and controls
49 lines (46 loc) · 1.14 KB
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
#docker-compose build --no-cache
#docker-compose up
#docker exec -it test_db /bin/bash
version: '3.7'
services:
db:
container_name: "test_db"
build:
context: .
dockerfile: ./database/db.Dockerfile
networks:
- default
restart: always
image: mysql/mysql-server:8.0.23
ports:
# <Port exposed> : < MySQL Port running inside container>
- "3306:3306"
# setting some env vars to create the DB
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "api"
MYSQL_USER: "user"
MYSQL_PASSWORD: "password"
security_opt:
- seccomp:unconfined
# data mount to not loose data
volumes:
- mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
api:
container_name: "test_api"
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
depends_on:
- db
# Mount the working dir into the container, handy for development
# This is what makes the hot reloading work inside of a Docker container
volumes:
- .:/app/
networks:
default:
volumes:
mysql_data: