1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00
Maybe/.devcontainer/docker-compose.yml
Rob Zolkos d4751053f3
Fix database config for non-devcontainer environments (#318)
Back in this [commit](5f50ea3f02 (diff-5a674c769541a71f2471a45c0e9dde911b4455344e3131bddc5a363701ba6325R22-R23)) I added a default postgres user and password.

Often this is not the user and password that is used in non-devcontainer environments.

This commit uses environment variables that are set in the devcontainer to set the user and password in the database.yml file.

If the environment variables are not set, it falls back to the default user and password on the users system.
2024-02-05 22:17:50 -06:00

47 lines
770 B
YAML

version: "3"
services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
volumes:
- ..:/workspace:cached
- bundle_cache:/bundle
ports:
- "3000:3000"
command: sleep infinity
environment:
DB_HOST: db
HOST: "0.0.0.0"
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
depends_on:
- db
- redis
redis:
image: redis:latest
ports:
- "6379:6379"
db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
postgres-data:
bundle_cache: