-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (58 loc) · 1.65 KB
/
docker-compose.yml
File metadata and controls
63 lines (58 loc) · 1.65 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
version: '3.8'
services:
app:
build:
context: . # Path to where your Dockerfile is located
container_name: Backend-SpringBoot
ports:
- "8081:8081" # Map the app's port to your host
environment:
# Spring Boot database environment variables
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/pokemon_db
SPRING_DATASOURCE_USERNAME: laith
SPRING_DATASOURCE_PASSWORD: admin
env_file:
- .env # Load environment variables from the .env file
depends_on:
db:
condition: service_healthy
volumes:
- ./data:/data # Mount the folder containing your CSV files
- ./init-scripts:/init-scripts # Mount SQL scripts for initialization
networks:
- pokemon-net
db:
image: postgres:latest
container_name: Database-postgresql
environment:
POSTGRES_DB: pokemon_db
POSTGRES_USER: laith
POSTGRES_PASSWORD: admin
ports:
- "5432:5432" # Map the PostgreSQL port to your host
volumes:
- postgres-data:/var/lib/postgresql/data # Persist data across container restarts
- ./data:/data # Mount the folder containing your CSV files
# - ./init-scripts:/docker-entrypoint-initdb.d # Mount SQL scripts for initialization
healthcheck:
test: ["CMD-SHELL", "pg_isready -U laith -d pokemon_db || exit 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- pokemon-net
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: Frontend-React
ports:
- "80:80"
depends_on:
- app
networks:
- pokemon-net
volumes:
postgres-data:
networks:
pokemon-net: