-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
79 lines (72 loc) · 3.94 KB
/
docker-compose.dev.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
version: "3.8"
services:
database:
image: mysql:8.0-debian
ports:
- 3307:3306 # Port 3306 in localhost may already be occupied by MySQL, so you can map it to a different port (e.g. port 3307)
restart: unless-stopped
volumes:
- navcraft_data:/var/lib/mysql # This works for general linux and MacOs. If running on Windows, or if your MySQL configuration is different, find the location of your MySQL data-storage directory
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u root", "--password=your_db_password"]
start_period: 5s
interval: 5s
timeout: 30s
retries: 20
# ---------- NOTE: Adjust environment variables as desired ----------
environment:
MYSQL_ROOT_PASSWORD: your_db_password # Must be the same in all services
MYSQL_DATABASE: name_your_database # Must be the same in all services
# ------------------------------------------- || -------------------------------------------
navcraft-api:
build:
context: ../navcraft-api
dockerfile: Dockerfile.dev
image: navcraft-api:1 # Adjust tag number if appropriate
command: pipenv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
ports:
- 8000:8000 # If you change it here, adjust the API-url in the other navbrix-api. If port 8000 is already occupied in your local machine, map to a different port
restart: unless-stopped
volumes:
- ../navcraft-api/src:/app/src:ro
depends_on:
database:
condition: service_healthy
# ---------- NOTE: Adjust environment variables as desired ----------
environment:
NAVCRAFT_API_DB_PASSWORD: your_db_password # Must be the same in all services
NAVCRAFT_API_DB_HOST: database # Don't change it unless you know what you're doing
NAVCRAFT_API_DB_NAME: name_your_database # Must be the same in all services
NAVCRAFT_API_MASTER_USER_NAME: Master User Name
NAVCRAFT_API_MASTER_USER_EMAIL: [email protected]
NAVCRAFT_API_MASTER_USER_WEIGHT: 200 # Weight in lbs
NAVCRAFT_API_MASTER_USER_PASSWORD: masterUserPassword1 # At least one uppercase and one number
NAVCRAFT_API_JWT_SECRET_KEY: RandomStringForJWTkey # Must be the same in both APIs. Random long strings are preferred
NAVCRAFT_API_JWT_ALGORITHM: HS256 # Must be the same in both APIs. Change it if you prefer a different algorithm, but HS256 works fine
NAVCRAFT_API_SENTRY_DSN: "" # The app will run without the DSN, but if you want to track your app's performance with sentry, you need to create a sentry project and add your DSN here.
# ------------------------------------------- || -------------------------------------------
navbrix-api:
build:
context: ./
dockerfile: Dockerfile.dev
image: navbrix-api:1 # Adjust tag number if appropriate
ports:
- 3000:3000 # If port 3000 is already occupied in your local machine, map to a different port
restart: unless-stopped
volumes:
- ./src:/app/src:ro
# ---------- NOTE: Adjust environment variables as desired ----------
environment:
DATABASE_URL: mysql://root:your_db_password@database:3306/name_your_database # Adjust db-password and db-name as above two services
NAVBRIX_API_NAVCRAFT_API_URL: http://127.0.0.1:8000/docs
NAVBRIX_API_JWT_SECRET_KEY: RandomStringForJWTkey # Must be the same in both APIs. Random long strings are preferred
NAVBRIX_API_JWT_ALGORITHM: HS256 # Must be the same in both APIs. Change it if you prefer a different algorithm, but HS256 works fine
NAVBRIX_API_SENTRY_DSN: "" # The app will run without the DSN, but if you want to track your app's performance with sentry, you need to create a sentry project and add your DSN here.
depends_on:
database:
condition: service_healthy
navcraft-api:
condition: service_started
# -------------------------------------------- || --------------------------------------------
volumes:
navcraft_data: