[add] Database initiated along with container
This commit is contained in:
parent
f2237d9209
commit
b25346e3d5
1
database/.dockerignore
Normal file
1
database/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
Dockerfile
|
3
database/Dockerfile
Normal file
3
database/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM mysql:5.7
|
||||
|
||||
ADD . /docker-entrypoint-initdb.d
|
@ -6,20 +6,21 @@ services:
|
||||
ports:
|
||||
- "8085:80"
|
||||
volumes:
|
||||
- .:/var/www/site
|
||||
- api-payroll:/var/www/site
|
||||
depends_on:
|
||||
- mysql
|
||||
mysql:
|
||||
container_name: payroll_mysql
|
||||
restart: always
|
||||
image: mysql:5.7
|
||||
build: database
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- my-datavolume:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: '12345678'
|
||||
MYSQL_USER: 'sloth'
|
||||
MYSQL_PASS: '12345678'
|
||||
volumes:
|
||||
- my-datavolume:/var/lib/mysql
|
||||
volumes:
|
||||
api-payroll:
|
||||
my-datavolume:
|
||||
|
Loading…
Reference in New Issue
Block a user