Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
65 lines (61 loc) · 1.82 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
65 lines (61 loc) · 1.82 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
mysql:
image: mysql:8.0
container_name: final-store-mysql-dev
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-0000}
MYSQL_DATABASE: ${MYSQL_DATABASE:-my_store}
ports:
- "${MYSQL_PORT:-3307}:3306"
volumes:
- mysql_dev_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-0000}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- final-store-network
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: final-store-app-dev
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: docker
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${MYSQL_DATABASE:-my_store}?useSSL=false&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: ${MYSQL_ROOT_PASSWORD:-0000}
JWT_SECRET: ${JWT_SECRET}
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_PUBLISHABLE_KEY: ${STRIPE_PUBLISHABLE_KEY}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
# Enable Spring Boot DevTools
SPRING_DEVTOOLS_RESTART_ENABLED: "true"
SPRING_DEVTOOLS_LIVERELOAD_ENABLED: "true"
ports:
- "8080:8080"
- "5005:5005" # Debug port
- "35729:35729" # LiveReload port
volumes:
# Mount source code for hot reload
- ./src:/app/src:delegated
- ./pom.xml:/app/pom.xml:ro
# Cache Maven dependencies to avoid re-downloading
- maven_cache:/root/.m2
networks:
- final-store-network
volumes:
mysql_dev_data:
driver: local
maven_cache:
driver: local
networks:
final-store-network:
driver: bridge