mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-09 17:51:23 +00:00
Update docker-compose to work with DB out of box
This commit is contained in:
parent
dc332a8062
commit
79533b19a3
7 changed files with 17 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
Dockerfile
|
Dockerfile
|
||||||
db_data
|
db_data
|
||||||
|
db/data/
|
||||||
dkim
|
dkim
|
||||||
log/*
|
log/*
|
||||||
public/*
|
public/*
|
|
@ -6,6 +6,7 @@ RAILS_ENV=development
|
||||||
APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba
|
APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba
|
||||||
|
|
||||||
DEPLOY_PATH=/var/www
|
DEPLOY_PATH=/var/www
|
||||||
|
FILES_PATH=/var/www/files
|
||||||
|
|
||||||
PUMA_WORKERS=0
|
PUMA_WORKERS=0
|
||||||
PUMA_MIN_THREADS=1
|
PUMA_MIN_THREADS=1
|
||||||
|
|
|
@ -22,7 +22,10 @@ PUMA_PORT=4000
|
||||||
# Use higher timeout if debug fails
|
# Use higher timeout if debug fails
|
||||||
PUMA_TIMEOUT=30
|
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
|
MYSQL_HOST=db
|
||||||
|
|
||||||
# This is used by both rails + mysql
|
# This is used by both rails + mysql
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -18,6 +18,10 @@
|
||||||
# Database and files
|
# Database and files
|
||||||
db_data/*
|
db_data/*
|
||||||
!db_data/.placeholder
|
!db_data/.placeholder
|
||||||
|
db/data/
|
||||||
|
!db/data/.placeholder
|
||||||
|
db/initdb.d/*
|
||||||
|
!db/initdb.d/.placeholder
|
||||||
*.sql*
|
*.sql*
|
||||||
|
|
||||||
# ignore dkim keys
|
# ignore dkim keys
|
||||||
|
|
|
@ -33,6 +33,8 @@ First build the ENSL docker containers.
|
||||||
|
|
||||||
docker-compose build
|
docker-compose build
|
||||||
|
|
||||||
|
Put any database dumps to `db/initdb.d`.
|
||||||
|
|
||||||
a) Then start for **production**:
|
a) Then start for **production**:
|
||||||
|
|
||||||
docker-compose up
|
docker-compose up
|
||||||
|
|
0
db/initdb.d/.placeholder
Normal file
0
db/initdb.d/.placeholder
Normal file
|
@ -13,7 +13,7 @@ services:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: Dockerfile.dev
|
dockerfile: Dockerfile.dev
|
||||||
# args:
|
# args:
|
||||||
# buildno: 1
|
# buildno: 1
|
||||||
volumes:
|
volumes:
|
||||||
- ".:/var/www/"
|
- ".:/var/www/"
|
||||||
ports:
|
ports:
|
||||||
|
@ -87,11 +87,13 @@ services:
|
||||||
# Debug
|
# Debug
|
||||||
#command: bash
|
#command: bash
|
||||||
#tty: true
|
#tty: true
|
||||||
command: mysqld_safe --skip-grant-tables
|
# command: mysqld_safe --skip-grant-tables
|
||||||
image: mariadb:latest
|
image: mariadb:latest
|
||||||
container_name: ensl_dev_db
|
container_name: ensl_dev_db
|
||||||
|
user: "mysql:mysql"
|
||||||
volumes:
|
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"
|
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE=ensl
|
- MYSQL_DATABASE=ensl
|
||||||
|
|
Loading…
Reference in a new issue