-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
62 lines (56 loc) · 1.58 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
48
49
50
51
52
53
54
55
56
57
58
59
60
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: mypiggy_backend
ports:
- "8080:8080"
working_dir: /app
volumes:
- ./backend:/app # Mapeando todo o diretório do backend
- ~/.m2:/root/.m2 # Cache do Maven
environment:
- DATASOURCE_URL=jdbc:postgresql://mypiggy_postgres:5432/myPiggy
- DATASOURCE_USERNAME=myuser
- DATASOURCE_PASSWORD=mypassword
depends_on:
- postgres
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: mypiggy_frontend
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:8080/
volumes:
- ./frontend:/app # Mapeando o código do frontend para o contêiner
- /app/node_modules # Persistir as dependências do node_modules
postgres:
image: postgres:latest
container_name: mypiggy_postgres
environment:
POSTGRES_DB: myPiggy
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
ports:
- "5432:5432" # Expondo a porta 5432 do container para a porta 5432 da máquina local
volumes:
- postgres_data:/var/lib/postgresql/data # Persistência do banco de dados
pgadmin:
image: dpage/pgadmin4:latest
container_name: mypiggy_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@example.com
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "5050:80"
depends_on:
- postgres
volumes:
- pgadmin_data:/var/lib/pgadmin # Persistência de dados do pgAdmin
volumes:
postgres_data:
pgadmin_data: