Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
remake docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
tbwrigh committed Apr 2, 2024
1 parent 4f5043f commit 892d609
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 23 deletions.
53 changes: 30 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ services:
timeout: 5s
retries: 10
start_period: 10s
ports:
- 5432:5432
volumes:
- orecart-db-volume:/var/lib/postgresql/data
- orecart-db-dev-volume:/var/lib/postgresql/data
env_file:
- database.env
networks:
- prod
- dev
migration:
container_name: orecart-migration
build: ./backend
Expand All @@ -27,11 +29,13 @@ services:
database:
condition: service_healthy
networks:
- prod
- dev
backend:
container_name: orecart-backend
build: ./backend
restart: always
ports:
- 8000:8000
env_file:
- backend.env
healthcheck:
Expand All @@ -44,26 +48,29 @@ services:
migration:
condition: service_completed_successfully
networks:
- prod
# frontend-admin:
# container_name: orecart-frontend-admin
# build: ./frontend-admin
# restart: always
# ports:
# - 5173:5173
# env_file:
# - frontend-admin.env
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:5173/"]
# interval: 30s
# timeout: 5s
# retries: 10
# start_period: 10s
# depends_on:
# backend:
# condition: service_healthy
- dev
frontend-admin:
container_name: orecart-frontend-admin
build: ./frontend-admin
restart: always
ports:
- 5173:5173
env_file:
- frontend-admin.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5173/"]
interval: 30s
timeout: 5s
retries: 10
start_period: 10s
depends_on:
backend:
condition: service_healthy
networks:
- dev

networks:
prod:
dev:

volumes:
orecart-db-volume: {}
orecart-db-dev-volume: {}
52 changes: 52 additions & 0 deletions prod.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: "3.9"

services:
database:
container_name: orecart-database
image: postgres
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 5s
retries: 10
start_period: 10s
volumes:
- orecart-db-volume:/var/lib/postgresql/data
env_file:
- database.env
networks:
- prod
migration:
container_name: orecart-migration
build: ./backend
command: alembic upgrade head
env_file:
- backend.env
depends_on:
database:
condition: service_healthy
networks:
- prod
backend:
container_name: orecart-backend
build: ./backend
restart: always
env_file:
- backend.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/docs"]
interval: 30s
timeout: 5s
retries: 10
start_period: 10s
depends_on:
migration:
condition: service_completed_successfully
networks:
- prod
networks:
prod:

volumes:
orecart-db-volume: {}
69 changes: 69 additions & 0 deletions staging.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: "3.9"

services:
database:
container_name: orecart-database
image: postgres
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 5s
retries: 10
start_period: 10s
volumes:
- orecart-db-volume:/var/lib/postgresql/data
env_file:
- database.env
networks:
- prod
migration:
container_name: orecart-migration
build: ./backend
command: alembic upgrade head
env_file:
- backend.env
depends_on:
database:
condition: service_healthy
networks:
- prod
backend:
container_name: orecart-backend
build: ./backend
restart: always
env_file:
- backend.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/docs"]
interval: 30s
timeout: 5s
retries: 10
start_period: 10s
depends_on:
migration:
condition: service_completed_successfully
networks:
- prod
# frontend-admin:
# container_name: orecart-frontend-admin
# build: ./frontend-admin
# restart: always
# ports:
# - 5173:5173
# env_file:
# - frontend-admin.env
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:5173/"]
# interval: 30s
# timeout: 5s
# retries: 10
# start_period: 10s
# depends_on:
# backend:
# condition: service_healthy
networks:
prod:

volumes:
orecart-db-volume: {}

0 comments on commit 892d609

Please sign in to comment.