Last active
May 17, 2020 20:59
-
-
Save ruiaraujo012/ae78454aa84eb8866c1d7cf35dfc7f14 to your computer and use it in GitHub Desktop.
Docker compose for Trademon project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
frontend: | |
build: ./PoGoTrades-Frontend | |
ports: | |
- "3000:3000" | |
volumes: | |
- ./PoGoTrades-Frontend:/frontend/ | |
- /frontend/node_modules/ | |
backend: | |
build: | |
context: ./PoGoTrades-Backend | |
dockerfile: Dockerfile-test | |
environment: | |
DB_USER: postgres | |
DB_PASSWORD: postgres | |
DB_NAME: PoGoTrades | |
DB_HOST: database | |
DB_PORT: 5432 | |
DB_DIALECT: postgres | |
DB_RECREATE: 1 # To recreate database (tests only) | |
JWT_SECRET: PoGoTradesSecret | |
ports: | |
- "8000:8000" | |
volumes: | |
- ./PoGoTrades-Backend:/backend/ | |
- /backend/node_modules/ | |
depends_on: | |
- database | |
command: ["./wait-for-it.sh", "database:5432", "--", "yarn", "run", "test"] | |
database: | |
image: postgres:latest | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: PoGoTrades | |
ports: | |
- "5432:5432" | |
volumes: | |
- ~/databases/PoGoTrades:/var/lib/postgresql/data | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U postgres"] | |
interval: 30s | |
timeout: 30s | |
retries: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
frontend: | |
container_name: Squirtle | |
build: ./Trademon-Frontend | |
ports: | |
- "3000:3000" | |
volumes: | |
- ./Trademon-Frontend:/frontend/ | |
- /frontend/node_modules/ | |
backend: | |
container_name: Bulbasaur | |
build: ./Trademon-Backend | |
environment: | |
DB_USER: postgres | |
DB_PASSWORD: postgres | |
DB_NAME: Trademon | |
DB_HOST: database | |
DB_PORT: 5432 | |
DB_DIALECT: postgres | |
DB_RECREATE: 0 # To recreate database | |
JWT_SECRET: TrademonSecret | |
ports: | |
- "8000:8000" | |
volumes: | |
- ./Trademon-Backend:/backend/ | |
- /backend/node_modules/ | |
depends_on: | |
- database | |
command: ["./wait-for-it.sh", "database:5432", "--", "nodemon"] | |
database: | |
container_name: Charmander | |
image: postgres:alpine | |
restart: always | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: Trademon | |
volumes: | |
- ~/databases/Trademon:/var/lib/postgresql/data | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U postgres"] | |
interval: 30s | |
timeout: 30s | |
retries: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment