Skip to content

Commit

Permalink
Docker compose up file matched to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vacaramin committed Dec 10, 2023
1 parent 99084e2 commit 5e5d6bf
Showing 1 changed file with 49 additions and 30 deletions.
79 changes: 49 additions & 30 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ networks:
services:
db:
image: postgres
container_name: pg
container_name: pg-database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: helloworld
Expand All @@ -22,25 +22,57 @@ services:
- "5434:5432"
restart: always
networks:
vh-net:
ipv4_address: 172.19.0.5
- vh-net
user: postgres
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- db-data:/var/lib/postgresql/data
# backend:
# build:
# context: ./backend
# dockerfile: ./Dockerfile
# env_file:
# - ./backend/.env
# ports:
# - "4000:4000"
# depends_on:
# - db
# networks:
# vh-net:
# ipv4_address: 172.19.0.7

migrate:
image: migrate/migrate
networks:
- vh-net
volumes:
- ./backend/Migrations:/migrations
depends_on:
- db
entrypoint: ["/bin/sh", "-c"]
command: >
'yes | migrate -path /migrations -database "postgres://postgres:helloworld@db:5432/postgres?sslmode=disable" down &&
migrate -path /migrations -database "postgres://postgres:helloworld@db:5432/postgres?sslmode=disable" up'
backend:
build:
context: ./backend
dockerfile: ./Dockerfile
env_file:
- ./backend/.env
ports:
- "4000:4000"
depends_on:
- migrate
- db
networks:
- vh-net

frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
networks:
- vh-net
volumes:
- /app/node_modules
- ./frontend:/app





# pgadmin:
# container_name: pgadmin
# environment:
Expand All @@ -55,18 +87,5 @@ services:
# networks:
# vh-net:
# ipv4_address: 172.19.0.6
# frontend:
# build:
# context: ./frontend
# dockerfile: ./Dockerfile
# ports:
# - "3000:3000"
# depends_on:
# - backend
# networks:
# vh-net:
# ipv4_address: 172.19.0.9

volumes:
db-data:

db-data:

0 comments on commit 5e5d6bf

Please sign in to comment.