feat: add docker db

This commit is contained in:
Vinicius Souza 2024-08-08 14:55:43 +00:00
parent fe480828f4
commit dac9a26a3a
2 changed files with 36 additions and 0 deletions

5
.env Normal file
View file

@ -0,0 +1,5 @@
WRSR_DATABASE_NAME="wsrs"
WRSR_DATABASE_USER="postgres"
WRSR_DATABASE_PASSWORD="123456789"
WRSR_DATABASE_PORT=5432
WRSR_DATABASE_HOST="localhost"

31
compose.yml Normal file
View file

@ -0,0 +1,31 @@
services:
db:
image: postgres:latest
restart: unless-stopped
ports:
- ${WRSR_DATABASE_PORT:-5432}:5432
environment:
POSTGRES_USER: ${WRSR_DATABASE_USER}
POSTGRES_PASSWORD: ${WRSR_DATABASE_PASSWORD}
POSTGRES_DB: ${WRSR_DATABASE_NAME}
volumes:
- db:/var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4:latest
restart: unless-stopped
depends_on:
- db
ports:
- 8081:80
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: password
volumes:
- pgadmin:/var/lib/pgadmin
volumes:
db:
driver: local
pgadmin:
driver: local