Skip to content

Commit

Permalink
Merge pull request #28 from nspalo/development
Browse files Browse the repository at this point in the history
Env Updates
  • Loading branch information
nspalo authored Sep 9, 2021
2 parents 072ab87 + 358d625 commit 8e8c006
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
19 changes: 11 additions & 8 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ services:
tty: true
ports:
- "3306:3306"
env_file:
- ${PATH_ENV_CONFIGS}/${SYS_ENV}.env
volumes:
- "${DB_MYSQL_VOLUME}:/var/lib/mysql"
- "${DB_VOLUME}:/var/lib/mysql"
environment:
MYSQL_DATABASE: "${DB_MYSQL_DATABASE}"
MYSQL_USER: "${DB_MYSQL_USER}"
MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD}"
MYSQL_ROOT_PASSWORD: "${DB_MYSQL_ROOT_PASSWORD}"
# MYSQL_DATABASE: "${DB_NAME}"
# MYSQL_USER: "${DB_USERNAME}"
# MYSQL_PASSWORD: "${DB_PASSWORD}"
# MYSQL_ROOT_PASSWORD: "${DB_PASSWORD_ROOT}"
SERVICE_TAGS: dev
SERVICE_NAME: mysql

Expand Down Expand Up @@ -81,7 +83,7 @@ services:
image: node:16-alpine
working_dir: /var/www/html
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"
- "${PATH_PROJECT_SOURCE}:/var/www/html"
entrypoint: ['npm']

# Container: Artisan
Expand All @@ -94,10 +96,11 @@ services:
dockerfile: containers/php/Dockerfile
image: artisan:laravel-5.8
env_file:
- ../docker/environments/${APP_ENV}.env
- ${PATH_ENV_CONFIGS}/config.env
- ${PATH_ENV_CONFIGS}/${SYS_ENV}.env
working_dir: /var/www/html
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"
- "${PATH_PROJECT_SOURCE}:/var/www/html"
depends_on:
- mysql
entrypoint: ['/var/www/html/artisan']
19 changes: 19 additions & 0 deletions docker/environments/config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Docker Environment Config
#============================

# ENVIROMENT
SYS_ENV=local

# DIRECTORIES / VOLUMES / PATHS
PATH_PROJECT_SOURCE=../src
PATH_NGINX=./containers/nginx
PATH_NGINX_CONFIGS=${PATH_NGINX}/conf.d/default.conf
PATH_ENV_CONFIGS=./environments
PATH_DATABASE=./volumes/mysql

# DATABASE
DB_DRIVER=mysql
DB_VERSION=5.7.22
DB_PORT=3306
DB_VOLUME=${PATH_DATABASE}/${DB_DRIVER}_${DB_VERSION}
22 changes: 5 additions & 17 deletions docker/environments/local.env
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
#
# Docker Environment - Local
#

# Enviroment
APP_ENV=local

# DIRECTORIES / VOLUMES / PATHS
PATH_ENV_CONFIG=../docker/environments/${APP_ENV}.env
PATH_PROJECT_SOURCE=../src
PATH_NGINX=../docker/containers/nginx
PATH_NGINX_CONFIGS=${PATH_NGINX}/conf.d/default.conf
PATH_DATABASE=../docker/volumes/mysql
#============================

# DATABASE
DB_MYSQL_VERSION_MYSQL=5.7.22
DB_MYSQL_VOLUME=${PATH_DATABASE}/mysql_${DB_MYSQL_VERSION_MYSQL}
DB_MYSQL_DATABASE=db_docker_study
DB_MYSQL_USER=dbUserDev
DB_MYSQL_PASSWORD=dbUserDev123
DB_MYSQL_ROOT_PASSWORD=dbUserRoot123
MYSQL_DATABASE=db_docker_laravel
MYSQL_USER=dbUserDev
MYSQL_PASSWORD=dbUserDev123
MYSQL_ROOT_PASSWORD=dbUserRoot123

0 comments on commit 8e8c006

Please sign in to comment.