Skip to content

Commit

Permalink
refactor: clean up docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsier committed May 22, 2024
1 parent 0c6473d commit a62dda4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 30 deletions.
27 changes: 0 additions & 27 deletions docker-compose.override.yml

This file was deleted.

28 changes: 26 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
version: "3"
services:
postgres:
image: mdillon/postgis:11 #this may affect drivers for rstudio!
image: mdillon/postgis:11
ports:
- "35432:5432"
env_file: ./envs/db.env
volumes:
- ./pg/data:/var/lib/postgresql/data
api:
build:
context: ./server/
dockerfile: Dockerfile.dev
depends_on:
- postgres
env_file: ./envs/api.env
ports:
- "5000:5000"
volumes:
- ./server/:/app/
- /app/node_modules
client:
build:
context: ./client/
dockerfile: Dockerfile.dev
depends_on:
- api
env_file: ./envs/client.env
ports:
- "5173:5173"
volumes:
- ./client/:/app/
- /app/node_modules
stdin_open: true
2 changes: 1 addition & 1 deletion server/db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { Pool } = require("pg")
//DB Connection
const CONNECTION_STRING =
process.env.DATABASE_URL ||
`postgresql://${process.env.DATABASE_USERNAME}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}/${process.env.DATABASE_NAME}`
`postgresql://${process.env.DATABASE_USERNAME}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_NAME}`

const pool = new Pool({
connectionString: CONNECTION_STRING,
Expand Down

0 comments on commit a62dda4

Please sign in to comment.