[web] Refactor docker stuff

This commit is contained in:
orosmatthew 2024-02-17 14:02:30 -05:00
parent 1df2feeed7
commit 245b987db9
4 changed files with 23 additions and 8 deletions

View File

@ -1,3 +1 @@
DATABASE_PASSWORD="password" DATABASE_URL=postgresql://bwcontest:password@127.0.0.1:5432/bwcontest
DATABASE_USER="user"
DATABASE_DB="contest"

1
web/.gitignore vendored
View File

@ -10,4 +10,3 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-* vite.config.ts.timestamp-*
temp temp
db db
docker-compose.yml

View File

@ -5,9 +5,9 @@ services:
volumes: volumes:
- ./db:/var/lib/postgresql/data - ./db:/var/lib/postgresql/data
environment: environment:
- POSTGRES_PASSWORD=${DATABASE_PASSWORD} - POSTGRES_PASSWORD=password
- POSTGRES_USER=${DATABASE_USER} - POSTGRES_USER=bwcontest
- POSTGRES_DB=${DATABASE_DB} - POSTGRES_DB=bwcontest
restart: unless-stopped restart: unless-stopped
web: web:
build: . build: .
@ -15,7 +15,7 @@ services:
- 3000:3000 - 3000:3000
- 7006:7006 - 7006:7006
environment: environment:
- DATABASE_URL=postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@db:5432/${DATABASE_DB} - DATABASE_URL=postgresql://bwcontest:password@db:5432/bwcontest
- GIT_PORT=7006 - GIT_PORT=7006
- ORIGIN=http://127.0.0.1:3000 - ORIGIN=http://127.0.0.1:3000
volumes: volumes:

View File

@ -0,0 +1,18 @@
version: '3'
services:
db:
image: "postgres:latest"
container_name: 'bwcontest-postgres'
restart: unless-stopped
environment:
POSTGRES_DB: 'bwcontest'
POSTGRES_USER: 'bwcontest'
POSTGRES_PASSWORD: 'password'
TZ: America/New_York
ports:
- '5432:5432'
volumes:
- bwcontest-postgres-data:/var/lib/postgresql/data
volumes:
bwcontest-postgres-data: