64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
version: "3.3"
|
|
|
|
services:
|
|
pg:
|
|
image: postgres:latest
|
|
environment:
|
|
POSTGRES_USER: '${POSTGRES_USER}'
|
|
POSTGRES_DB: '${POSTGRES_DB}'
|
|
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
|
|
volumes:
|
|
# so ez
|
|
# insane
|
|
- "./pg:/docker-entrypoint-initdb.d"
|
|
ports:
|
|
- '45432:5432'
|
|
|
|
api:
|
|
image: crates/api
|
|
build:
|
|
context: ./api
|
|
dockerfile: ./api.Dockerfile
|
|
working_dir: /opt/crates/api
|
|
depends_on:
|
|
- 'pg'
|
|
command: npm start
|
|
environment:
|
|
DATABASE_URL: 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?schema=public'
|
|
DISCORD_TOKEN: '${DISCORD_TOKEN}'
|
|
DISCOGS_TOKEN: '${DISCOGS_TOKEN}'
|
|
CHOKIDAR_USEPOLLING: 1
|
|
volumes:
|
|
- "./api:/opt/crates/api"
|
|
- "/opt/crates/api/node_modules"
|
|
|
|
migrate:
|
|
restart: on-failure:3
|
|
extends: api
|
|
command: npm run migrate status
|
|
|
|
client:
|
|
image: node:16
|
|
working_dir: /opt/crates/client
|
|
build:
|
|
context: ./client
|
|
dockerfile: ./client.dev.Dockerfile
|
|
entrypoint: npm start
|
|
ports:
|
|
- '8080:8080' # fwd the hmr websocket
|
|
environment:
|
|
CHOKIDAR_USEPOLLING: 1
|
|
volumes:
|
|
- "./client:/opt/crates/client"
|
|
- "./api:/opt/crates/api"
|
|
- "/opt/crates/client/node_modules"
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
depends_on:
|
|
- 'api'
|
|
volumes:
|
|
- './nginx/localhost.nginx.conf:/etc/nginx/conf.d/default.conf'
|
|
ports:
|
|
- '80:80'
|