-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
47 lines (45 loc) · 1.11 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
services:
stars-api:
build: .
container_name: stars-api
environment:
PORT: 8000
DEBUG: 1
DB_DRIVER: mysql+mysqlconnector
DB_USERNAME: mysql
DB_PASSWORD: mysql
DB_HOST: mysql_database
DB_PORT: 3306
DB_DATABASE: db
JWT_SECRETE_KEY: testestestestetsteste
PASSWORD_HASH_ALGORITHM: HS256
JWT_EXPIRE_MINUTES: 30
ports:
- '8000:80'
volumes:
- ./app:/code/app
restart: on-failure
command: uvicorn app.main:app --host 0.0.0.0 --port 80 --reload
depends_on:
mysql_database:
condition: service_healthy
mysql_database:
image: mysql:8.3
restart: unless-stopped
command: --default-authentication-plugin=caching_sha2_password
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'mysql'
MYSQL_PASSWORD: 'mysql'
MYSQL_ROOT_PASSWORD: 'mysql'
ports:
- '3306:3306'
volumes:
- mysql_database:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
volumes:
mysql_database:
name: mysql_database