Skip to content

Commit

Permalink
fix: remove unnecessary stuff from docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
franTarkenton committed May 9, 2024
1 parent ca1ac5d commit 6cf7574
Showing 1 changed file with 15 additions and 52 deletions.
67 changes: 15 additions & 52 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
version: "3.9"

# leaving the db config in for now, as useful examples for deploying a postgis db
x-var:
- &POSTGRES_USER
postgres
Expand All @@ -16,52 +16,15 @@ x-postgres-vars: &postgres-vars
POSTGRES_DATABASE: *POSTGRES_DATABASE

services:
database:
image: postgres:15
container_name: database
environment:
<<: *postgres-vars
healthcheck:
test: ["CMD", "pg_isready", "-U", *POSTGRES_USER]
ports: ["5432:5432"]
# database:
# image: postgres:15
# container_name: database
# environment:
# <<: *postgres-vars
# healthcheck:
# test: ["CMD", "pg_isready", "-U", *POSTGRES_USER]
# ports: ["5432:5432"]

migrations:
image: flyway/flyway:9-alpine
container_name: migrations
command: info migrate info
volumes: ["./migrations/sql:/flyway/sql:ro"]
environment:
FLYWAY_URL: jdbc:postgresql://database:5432/postgres
FLYWAY_USER: *POSTGRES_USER
FLYWAY_PASSWORD: *POSTGRES_PASSWORD
FLYWAY_BASELINE_ON_MIGRATE: true
FLYWAY_DEFAULT_SCHEMA: users
depends_on:
database:
condition: service_healthy
schema_spy:
image: schemaspy/schemaspy:6.2.4
container_name: schemaspy
command: -t pgsql11 -db postgres -host database -port 5432 -u postgres -p default -schemas users
depends_on:
migrations:
condition: service_completed_successfully
volumes: ["./output:/output"]
backend:
container_name: backend
entrypoint: sh -c "npm i && npm run start:dev"
environment:
<<: *postgres-vars
NODE_ENV: development
image: node:20-bullseye
ports: ["3001:3000"]
volumes: ["./backend:/app", "/app/node_modules"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api"]
working_dir: "/app"
depends_on:
migrations:
condition: service_started

frontend:
container_name: frontend
Expand All @@ -76,9 +39,9 @@ services:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
working_dir: "/app"
depends_on:
backend:
condition: service_healthy
# depends_on:
# backend:
# condition: service_healthy

caddy:
container_name: caddy
Expand All @@ -93,6 +56,6 @@ services:
volumes: ["./frontend/Caddyfile:/etc/caddy/Caddyfile"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
depends_on:
backend:
condition: service_healthy
# depends_on:
# backend:
# condition: service_healthy

0 comments on commit 6cf7574

Please sign in to comment.