Skip to content

Commit 2dbd20f

Browse files
kfischer-okarinRedmine Patch Meetup
authored andcommitted
Add docker-compose and database.yml for mysql2 and postgresql
1 parent c2d5a39 commit 2dbd20f

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

config/database.mysql.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
default: &default
2+
adapter: mysql2
3+
host: <%= ENV.fetch('DB_HOST', '127.0.0.1') %>
4+
port: <%= ENV.fetch('DB_PORT', '3306') %>
5+
username: root
6+
password: password
7+
8+
production:
9+
<<: *default
10+
database: redmine_production
11+
12+
development:
13+
<<: *default
14+
database: redmine_development
15+
16+
test:
17+
<<: *default
18+
database: redmine_test

config/database.postgres.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
default: &default
2+
adapter: postgresql
3+
encoding: utf8
4+
host: <%= ENV.fetch('DB_HOST', 'localhost') %>
5+
port: <%= ENV.fetch('DB_PORT', '5432') %>
6+
username: postgres
7+
password: postgres
8+
9+
production:
10+
<<: *default
11+
database: redmine_production
12+
13+
development:
14+
<<: *default
15+
database: redmine_development
16+
17+
test:
18+
<<: *default
19+
database: redmine_test

docker-compose.mysql.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.4'
2+
services:
3+
db:
4+
image: mysql:${DB_VERSION:-latest}
5+
environment:
6+
MYSQL_ROOT_PASSWORD: password
7+
volumes:
8+
- mysql_data:/var/lib/mysql
9+
ports:
10+
- "3306:3306"
11+
12+
13+
volumes:
14+
mysql_data:

docker-compose.postgres.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3.4'
2+
services:
3+
db:
4+
image: postgres:${DB_VERSION:-latest}
5+
volumes:
6+
- postgres_data:/var/lib/postgresql
7+
ports:
8+
- "5432:5432"
9+
environment:
10+
LANG: C.UTF-8
11+
POSTGRES_INITDB_ARGS: --locale=C.UTF-8
12+
POSTGRES_PASSWORD: postgres
13+
14+
volumes:
15+
postgres_data:

0 commit comments

Comments
 (0)