Skip to content

Commit

Permalink
WIP 2
Browse files Browse the repository at this point in the history
  • Loading branch information
abmmhasan committed Jan 5, 2025
1 parent 8fac997 commit df0bf65
Show file tree
Hide file tree
Showing 21 changed files with 238 additions and 164 deletions.
2 changes: 2 additions & 0 deletions configuration/rootCA/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
37 changes: 8 additions & 29 deletions docker/compose/companion.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
x-base-service: &default-service
environment:
- TZ=${TZ:-}
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro

services:
certbot:
<<: *default-service
build:
context: ../conf/docker-files
dockerfile: certbot.Dockerfile
container_name: CERTIFICATE_BOT
hostname: certbot
profiles:
- certbot
restart: always
volumes:
- ./configuration/ssl:/etc/letsencrypt
- ./configuration/certbot:/var/www/certbot
- /var/run/docker.sock:/var/run/docker.sock
entrypoint: [ "/bin/bash", "/usr/local/bin/certbot-renew" ]
networks:
- cert

server-tools:
<<: *default-service
container_name: SERVER_TOOLS
hostname: server-tools
build:
Expand All @@ -35,10 +9,15 @@ services:
UID: ${UID:-1000}
GID: ${GID:-root}
restart: always
environment:
- TZ=${TZ:-}
volumes:
- ./configuration/ssl:/etc/ssl/custom
- ./configuration/ssh:/home/devuser/.ssh
- "${PROJECT_DIR:-./../application}:/app"
- ../../configuration/ssl:/etc/mkcert
- ../../configuration/ssh:/home/devuser/.ssh
- "${PROJECT_DIR:-./../../../application}:/app"
# - ../../configuration/rootCA/rootCA.pem:/home/devuser/.local/share/mkcert/rootCA.pem
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- backend
33 changes: 14 additions & 19 deletions docker/compose/http.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
x-base-service: &default-service
environment:
- TZ=${TZ:-}
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro

services:
nginx:
<<: *default-service
container_name: NGINX
hostname: nginx
image: nginx:${NGINX_VERSION:-latest}
profiles:
- nginx
restart: always
environment:
- TZ=${TZ:-}
ports:
- "${NGINX_HTTP_PORT:-80}:80"
- "${NGINX_HTTPS_PORT:-443}:443"
volumes:
- ./docker/logs/nginx:/var/log/nginx
- ./configuration/nginx:/etc/nginx/conf.d
- ./configuration/ssl:/etc/letsencrypt
- ./configuration/certbot:/var/www/certbot
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ../../logs/nginx:/var/log/nginx
- ../../configuration/nginx:/etc/nginx/conf.d
- ../../configuration/ssl:/etc/mkcert
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- frontend
- cert
command: [ "/bin/sh", "-c", "nginx -g 'daemon off;'" ]
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost" ]
Expand All @@ -35,7 +29,6 @@ services:
retries: 3

apache:
<<: *default-service
container_name: APACHE
hostname: apache
build:
Expand All @@ -46,19 +39,21 @@ services:
profiles:
- apache
restart: always
environment:
- TZ=${TZ:-}
ports:
- "${APACHE_HTTP_PORT:-80}:80"
- "${APACHE_HTTPS_PORT:-443}:443"
volumes:
- ./configuration/ssl:/etc/letsencrypt
- ./docker/logs/apache:/var/log/apache2
- ./configuration/apache:/etc/apache2/sites-available
- ./configuration/certbot:/var/www/certbot
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ../../configuration/ssl:/etc/mkcert
- ../../configuration/apache:/etc/apache2/sites-available
- ../../logs/apache:/var/log/apache2
extra_hosts:
- 'host.docker.internal:host-gateway'
networks:
- frontend
- cert
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost" ]
interval: 30s
Expand Down
15 changes: 6 additions & 9 deletions docker/compose/main.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Devtainer

networks:
cert:
name: Certificate
driver: bridge
frontend:
name: Frontend
driver: bridge
Expand All @@ -15,10 +12,10 @@ include:
- docker/compose/http.yaml
- docker/compose/php-fpm.yaml
- docker/compose/php-cli.yaml
- docker/compose/mysql.yaml
- docker/compose/mariadb.yaml
- docker/compose/psql.yaml
- docker/compose/mongo.yaml
- docker/compose/elasticsearch.yaml
- docker/compose/redis.yaml
# - docker/compose/mysql.yaml
# - docker/compose/mariadb.yaml
# - docker/compose/psql.yaml
# - docker/compose/mongo.yaml
# - docker/compose/elasticsearch.yaml
# - docker/compose/redis.yaml
- docker/compose/companion.yaml
71 changes: 54 additions & 17 deletions docker/compose/php-cli.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
x-php-cli-service: &php-cli-service
build:
context: ../conf/docker-files
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
WORKING_DIR: ${WORKING_DIR}
restart: always
networks:
- backend
environment:
- TZ=${TZ:-}
env_file:
- "./.env"
- "../../.env"
networks:
- backend
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- "${PROJECT_DIR:-./../application}:/app"
- ./configuration/php/php.ini:/usr/local/etc/php/conf.d/99-overrides.ini
- ./docker/conf/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./docker/conf/php/openssl.cnf:/etc/ssl/openssl.cnf
- ./configuration/ssh:/home/devuser/.ssh
- "${PROJECT_DIR:-./../../../application}:/app"
- "../conf/php/openssl.cnf:/etc/ssl/openssl.cnf"
- "../../configuration/php/php.ini:/usr/local/etc/php/conf.d/99-overrides.ini"
- "../../configuration/ssh:/home/devuser/.ssh"
extra_hosts:
- "host.docker.internal:host-gateway"

Expand All @@ -32,7 +22,14 @@ services:
container_name: PHP_7.4_CLI
hostname: php-74-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 7.4
PHP_EXT_VERSIONED: ${PHP_EXT_74:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_74:-}
Expand All @@ -45,7 +42,15 @@ services:
container_name: PHP_8.0_CLI
hostname: php-80-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
NODE_VERSION: ${NODE_VERSION:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 8.0
PHP_EXT_VERSIONED: ${PHP_EXT_80:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_80:-}
Expand All @@ -58,7 +63,15 @@ services:
container_name: PHP_8.1_CLI
hostname: php-81-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
NODE_VERSION: ${NODE_VERSION:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 8.1
PHP_EXT_VERSIONED: ${PHP_EXT_81:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_81:-}
Expand All @@ -71,7 +84,15 @@ services:
container_name: PHP_8.2_CLI
hostname: php-82-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
NODE_VERSION: ${NODE_VERSION:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 8.2
PHP_EXT_VERSIONED: ${PHP_EXT_82:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_82:-}
Expand All @@ -84,7 +105,15 @@ services:
container_name: PHP_8.3_CLI
hostname: php-83-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
NODE_VERSION: ${NODE_VERSION:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 8.3
PHP_EXT_VERSIONED: ${PHP_EXT_83:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_83:-}
Expand All @@ -97,7 +126,15 @@ services:
container_name: PHP_8.4_CLI
hostname: php-84-cli
build:
context: "../conf/docker-files"
dockerfile: cli.Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-root}
PHP_EXT: ${PHP_EXT:-}
LINUX_PKG: ${LINUX_PKG:-}
NODE_VERSION: ${NODE_VERSION:-}
WORKING_DIR: ${WORKING_DIR}
PHP_VERSION: 8.4
PHP_EXT_VERSIONED: ${PHP_EXT_84:-}
LINUX_PKG_VERSIONED: ${LINUX_PKG_84:-}
Expand Down
Loading

0 comments on commit df0bf65

Please sign in to comment.