Skip to content

Commit ba36803

Browse files
authored
Merge pull request #34 from JawherKl/feature/22-update-docker
update docker compose
2 parents d12bb6a + 84c2625 commit ba36803

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ COPY . .
1717
EXPOSE 3000
1818

1919
# Command to run the application
20-
CMD ["node", "index.js"]
20+
CMD ["node", "src/index.js"]

docker-compose.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1-
version: '3.3'
1+
version: "3.3"
22

33
services:
4-
db:
5-
image: postgres:15
6-
environment:
7-
POSTGRES_USER: postgres
8-
POSTGRES_PASSWORD: postgres
9-
POSTGRES_DB: node_api_db
10-
ports:
11-
- "5400:5432"
12-
volumes:
13-
- postgres-data:/var/lib/postgresql/data
14-
healthcheck:
15-
test: ["CMD-SHELL", "pg_isready -U postgres"]
16-
interval: 10s
17-
timeout: 5s
18-
retries: 5
19-
204
node-api:
215
build:
226
context: .
237
dockerfile: Dockerfile
248
ports:
259
- "3000:3000"
2610
environment:
27-
- NODE_ENV=development
28-
- DATABASE_URL=postgresql://postgres:postgres@db:5400/node_api_db
29-
depends_on:
30-
- db
31-
11+
NODE_ENV: development
12+
DATABASE_URL: postgresql://postgres:postgres@host.docker.internal:5450/node_api_db
13+
extra_hosts:
14+
- "host.docker.internal:host-gateway"
15+
3216
prometheus:
3317
image: prom/prometheus
3418
volumes:
@@ -41,12 +25,10 @@ services:
4125
ports:
4226
- "3001:3000"
4327
environment:
44-
- GF_SECURITY_ADMIN_USER=admin
45-
- GF_SECURITY_ADMIN_PASSWORD=admin
28+
GF_SECURITY_ADMIN_USER: admin
29+
GF_SECURITY_ADMIN_PASSWORD: admin
4630
volumes:
4731
- grafana-storage:/var/lib/grafana
4832

4933
volumes:
5034
grafana-storage:
51-
postgres-data:
52-

0 commit comments

Comments
 (0)