File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ COPY . .
1717EXPOSE 3000
1818
1919# Command to run the application
20- CMD ["node" , "src/ index.js" ]
20+ CMD ["node" , "index.js" ]
Original file line number Diff line number Diff line change 11version : " 3.3"
22
33services :
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+
20+ pgadmin :
21+ image : dpage/pgadmin4
22+ environment :
23+ PGADMIN_DEFAULT_EMAIL : admin@admin.com
24+ PGADMIN_DEFAULT_PASSWORD : admin
25+ ports :
26+ - " 5404:80"
27+ depends_on :
28+ - db
29+ volumes :
30+ - pgadmin-data:/var/lib/pgadmin
31+ restart : always
32+
433 node-api :
534 build :
635 context : .
@@ -9,9 +38,11 @@ services:
938 - " 3000:3000"
1039 environment :
1140 NODE_ENV : development
12- DATABASE_URL : postgresql://postgres:postgres@host.docker.internal:5450 /node_api_db
41+ DATABASE_URL : postgresql://postgres:postgres@db:5432 /node_api_db
1342 extra_hosts :
1443 - " host.docker.internal:host-gateway"
44+ depends_on :
45+ - db
1546
1647 prometheus :
1748 image : prom/prometheus
@@ -31,4 +62,6 @@ services:
3162 - grafana-storage:/var/lib/grafana
3263
3364volumes :
65+ postgres-data :
66+ pgadmin-data :
3467 grafana-storage :
You can’t perform that action at this time.
0 commit comments