Update docker-compose to work with DB out of box

This commit is contained in:
Ari Timonen 2020-03-31 05:31:42 +03:00
parent dc332a8062
commit 79533b19a3
7 changed files with 17 additions and 4 deletions

View file

@ -1,5 +1,6 @@
Dockerfile
db_data
db/data/
dkim
log/*
public/*

View file

@ -6,6 +6,7 @@ RAILS_ENV=development
APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba
DEPLOY_PATH=/var/www
FILES_PATH=/var/www/files
PUMA_WORKERS=0
PUMA_MIN_THREADS=1

View file

@ -22,7 +22,10 @@ PUMA_PORT=4000
# Use higher timeout if debug fails
PUMA_TIMEOUT=30
# Docker adds mysql name to /etc/hosts
# Path to files
FILES_PATH=/var/www/files
# Docker adds mysql to hosts
MYSQL_HOST=db
# This is used by both rails + mysql

4
.gitignore vendored
View file

@ -18,6 +18,10 @@
# Database and files
db_data/*
!db_data/.placeholder
db/data/
!db/data/.placeholder
db/initdb.d/*
!db/initdb.d/.placeholder
*.sql*
# ignore dkim keys

View file

@ -33,6 +33,8 @@ First build the ENSL docker containers.
docker-compose build
Put any database dumps to `db/initdb.d`.
a) Then start for **production**:
docker-compose up

0
db/initdb.d/.placeholder Normal file
View file

View file

@ -13,7 +13,7 @@ services:
context: ./
dockerfile: Dockerfile.dev
# args:
# buildno: 1
# buildno: 1
volumes:
- ".:/var/www/"
ports:
@ -87,11 +87,13 @@ services:
# Debug
#command: bash
#tty: true
command: mysqld_safe --skip-grant-tables
# command: mysqld_safe --skip-grant-tables
image: mariadb:latest
container_name: ensl_dev_db
user: "mysql:mysql"
volumes:
- "./db_data:/var/lib/mysql"
- "./db/data:/var/lib/mysql"
- "./db/initdb.d:/docker-entrypoint-initdb.d"
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
environment:
- MYSQL_DATABASE=ensl