env file updated and automate database creation

This commit is contained in:
sskender 2020-09-28 14:14:58 +02:00
parent 3178bc0748
commit 880b5423b7
No known key found for this signature in database
GPG Key ID: 4E3947A16854E11C
3 changed files with 10 additions and 7 deletions

7
.env Normal file
View File

@ -0,0 +1,7 @@
# root user
MYSQL_ROOT_PASSWORD=roottoor
# custom user
MYSQL_USER=sskender
MYSQL_PASSWORD=password123
MYSQL_DATABASE=mydatabase

View File

@ -8,17 +8,15 @@ services:
build: build:
context: ./mariadb context: ./mariadb
dockerfile: Dockerfile dockerfile: Dockerfile
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
env_file: env_file:
- mariadb.env - ".env"
networks: networks:
- intranet - intranet
ports: ports:
- "3306:3306" - "3306:3306"
restart: always restart: always
volumes: volumes:
- mariadb:/var/lib/mysql - db_data:/var/lib/mysql
phpmyadmin: phpmyadmin:
container_name: phpmyadmin container_name: phpmyadmin
@ -40,4 +38,4 @@ networks:
volumes: volumes:
mariadb: db_data:

View File

@ -1,2 +0,0 @@
MYSQL_USER=sskender
MYSQL_PASSWORD=password