Skip to content

Commit

Permalink
feature/DLT-29-restructure
Browse files Browse the repository at this point in the history
- Update docker compose and file and scripts
  • Loading branch information
nspalo committed Sep 4, 2023
1 parent c87680f commit dd87f0b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 47 deletions.
4 changes: 2 additions & 2 deletions docker/containers/composer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# - use the image tag php:php-8.1-fpm-alpine
FROM php:php-8.1-fpm-alpine

# Install Composer 2.1.5
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.1.5
# Install Composer 2.6.1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.6.1

# Add composer bin files path to environment variable
RUN export PATH=$PATH":/usr/bin"
2 changes: 1 addition & 1 deletion docker/containers/mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Install MySQL
FROM library/mysql:8.0.30
FROM library/mysql:5.7.22
3 changes: 2 additions & 1 deletion docker/containers/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ FROM php:8.1-fpm-alpine
# Install PHP Extension
RUN apk --no-cache add zip libzip-dev \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip pdo pdo_mysql \
&& docker-php-ext-install zip mysqli pdo pdo_mysql \
&& docker-php-ext-enable pdo_mysql \
70 changes: 38 additions & 32 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
version: '3.8'

networks:
web-app:
Expand All @@ -7,7 +7,7 @@ services:
# +----------------------+ #
# | Container: NginX | #
# +----------------------+ #
nginx:
webserver:
networks:
- web-app
container_name: nginx
Expand All @@ -16,57 +16,58 @@ services:
dockerfile: containers/nginx/Dockerfile
image: nginx:nginx-stable-alpine
ports:
- "9100:80"
- "8080:80"
volumes:
- "${PATH_CONFIGS_NGINX}:/etc/nginx/conf.d/default.conf"
- "${PATH_PROJECT_SOURCE}:/var/www/html"
- "${PATH_NGINX_CONFIGS}:/etc/nginx/conf.d/default.conf"
depends_on:
- php
- mysql
- database

# +----------------------+ #
# | Container: PHP | #
# +----------------------+ #
php:
networks:
- web-app
container_name: php
build:
context: .
dockerfile: containers/php/Dockerfile
image: php:php-8.1-fpm-alpine
ports:
- "9000:9000"
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"

# +----------------------+ #
# | Container: MySQL | #
# +----------------------+ #
mysql:
database:
networks:
- web-app
container_name: mysql
command: mysqld --default-authentication-plugin=mysql_native_password
build:
context: .
dockerfile: containers/mysql/Dockerfile
image: mysql:mysql-8.0.30
image: mysql:mysql-${DB_VERSION}
# command: mysqld --default-authentication-plugin=mysql_native_password
restart: unless-stopped
tty: true
ports:
- "3306:3306"
env_file:
- ${PATH_ENV_CONFIGS}/${SYS_ENV}.env
- ${PATH_ENVIRONMENTS}/${SYS_ENV}.env
volumes:
- "${DB_VOLUME}:/var/lib/mysql"
environment:
SERVICE_TAGS: dev
SERVICE_NAME: mysql
# ---- Database Credentials ----
# MYSQL_DATABASE: "${DB_NAME}"
# MYSQL_USER: "${DB_USERNAME}"
# MYSQL_PASSWORD: "${DB_PASSWORD}"
# MYSQL_ROOT_PASSWORD: "${DB_PASSWORD_ROOT}"
SERVICE_TAGS: dev
SERVICE_NAME: mysql

# +----------------------+ #
# | Container: PHP | #
# +----------------------+ #
php:
networks:
- web-app
container_name: php
build:
context: .
dockerfile: containers/php/Dockerfile
image: php:php-8.1-fpm-alpine
ports:
- "9000:9000"
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"

# +----------------------+ #
# | Container: Composer | #
Expand All @@ -78,10 +79,12 @@ services:
build:
context: .
dockerfile: containers/composer/Dockerfile
image: composer:composer-2.1.5
image: composer:composer-2.6.1
working_dir: /var/www/html
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"
depends_on:
- php
entrypoint: ['composer']

# +----------------------+ #
Expand All @@ -108,12 +111,15 @@ services:
context: .
dockerfile: containers/php/Dockerfile
image: artisan:laravel-8
links:
- php
- database
env_file:
- ${PATH_ENV_CONFIGS}/config.env
- ${PATH_ENV_CONFIGS}/${SYS_ENV}.env
- ${PATH_ENVIRONMENTS}/${SYS_ENV}.env
working_dir: /var/www/html
volumes:
- "${PATH_PROJECT_SOURCE}:/var/www/html"
depends_on:
- mysql
entrypoint: ['/var/www/html/artisan']
- php
- database
entrypoint: ['php', '/var/www/html/artisan']
8 changes: 0 additions & 8 deletions scripts/docker-compose.sh

This file was deleted.

4 changes: 1 addition & 3 deletions scripts/prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

set -eo pipefail

#docker rmi -f $(docker images -q)
#docker rmi $(docker images)
#docker rmi $(docker images -qf dangling=true);
# Delete All Images
docker system prune -a --force
docker ps
docker images

0 comments on commit dd87f0b

Please sign in to comment.