Allow more flexible development DB config

This commit is contained in:
Emi Matchu 2025-11-11 12:20:25 -08:00
parent 4e2c99d4dd
commit b257de85f2
2 changed files with 12 additions and 9 deletions

View file

@ -7,7 +7,7 @@ services:
dockerfile: .devcontainer/Dockerfile
volumes:
- ../..:/workspaces:cached
- ../..:/workspaces:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
@ -18,17 +18,20 @@ services:
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
depends_on:
- mysql
- mysql
environment:
DB_USER: root
mysql:
image: mariadb:10.6
restart: unless-stopped
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
volumes:
- mysql-data:/var/lib/mysql
- mysql-data:/var/lib/mysql
networks:
- default
- default
volumes:
mysql-data:

View file

@ -3,7 +3,7 @@ development:
adapter: mysql2
host: <%= ENV.fetch("DB_HOST", "localhost") %>
database: openneo_impress
username: root
username: <%= ENV.fetch("DB_USER", ENV.fetch("USER", "root")) %>
pool: 5
encoding: utf8mb4
collation: utf8mb4_unicode_520_ci
@ -14,7 +14,7 @@ development:
adapter: mysql2
host: <%= ENV.fetch("DB_HOST", "localhost") %>
database: openneo_id
username: root
username: <%= ENV.fetch("DB_USER", ENV.fetch("USER", "root")) %>
pool: 2
variables:
sql_mode: TRADITIONAL
@ -25,7 +25,7 @@ test:
adapter: mysql2
host: <%= ENV.fetch("DB_HOST", "localhost") %>
database: openneo_impress_test
username: root
username: <%= ENV.fetch("DB_USER", ENV.fetch("USER", "root")) %>
pool: 5
encoding: utf8mb4
collation: utf8mb4_unicode_520_ci
@ -36,7 +36,7 @@ test:
adapter: mysql2
host: <%= ENV.fetch("DB_HOST", "localhost") %>
database: openneo_id_test
username: root
username: <%= ENV.fetch("DB_USER", ENV.fetch("USER", "root")) %>
pool: 2
variables:
sql_mode: TRADITIONAL