Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ COPY . .
EXPOSE 3000

# Command to run the application
CMD ["node", "index.js"]
CMD ["node", "src/index.js"]
34 changes: 8 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
version: '3.3'
version: "3.3"

services:
db:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: node_api_db
ports:
- "5400:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

node-api:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:postgres@db:5400/node_api_db
depends_on:
- db
NODE_ENV: development
DATABASE_URL: postgresql://postgres:postgres@host.docker.internal:5450/node_api_db
extra_hosts:
- "host.docker.internal:host-gateway"

prometheus:
image: prom/prometheus
volumes:
Expand All @@ -41,12 +25,10 @@ services:
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
volumes:
- grafana-storage:/var/lib/grafana

volumes:
grafana-storage:
postgres-data: