Refactored the application's dockerization and added new services

This commit involves significant changes to the application's infrastructure. It refactors the application into two separate services: 'nibiru-auth-api' and 'nibiru-webhook-receiver'. Each service has its corresponding Dockerfile, Nginx & PHP-FPM configuration. It also provides a separate Nginx configuration for handling requests for each service. New environment files, start and stop scripts are introduced to facilitate local and production deployments.
This commit is contained in:
stephan.kasdorf
2024-05-31 15:13:10 +02:00
parent 7e860b019a
commit 2572c28648
29 changed files with 568 additions and 72 deletions

View File

@@ -1,30 +1,92 @@
version: '3.3'
services:
php-fpm:
nibiru-auth-api:
build:
context: ./php-fpm
context: ./nibiru-auth-api/fpm
env_file:
- .env
environment:
- APPLICATION_ENV=${APPLICATION_ENV}
- VIRTUAL_HOST=${NIBIRU_AUTH_VIRTUAL_HOST}
- VIRTUAL_PORT=${FPM_VIRTUAL_PORT}
- NIBIRU_AUTH_VIRTUAL_HOST=${NIBIRU_AUTH_VIRTUAL_HOST}
- NIBIRU_AUTH_HOST=${NIBIRU_AUTH_HOST}
- TZ=${TZ}
volumes:
- ./src:/var/www/html
networks:
- nginx-proxy
api_internal:
restart: always
nginx:
image: nginx:latest
nibiru-auth-api-nginx:
build:
context: ./nibiru-auth-api/nginx
links:
- nibiru-auth-api
env_file:
- .env
environment:
- VIRTUAL_HOST=${VIRTUAL_HOST}
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
- VIRTUAL_PORT=${VIRTUAL_PORT}
- APPLICATION_ENV=${APPLICATION_ENV}
- VIRTUAL_HOST=${NIBIRU_AUTH_VIRTUAL_HOST}
- VIRTUAL_PORT=${NGINX_PROXY_VIRTUAL_PORT}
- FPM_VIRTUAL_PORT=${FPM_VIRTUAL_PORT}
- NIBIRU_AUTH_VIRTUAL_HOST=${NIBIRU_AUTH_VIRTUAL_HOST}
- NIBIRU_AUTH_HOST=${NIBIRU_AUTH_HOST}
- LETSENCRYPT_HOST=${NIBIRU_AUTH_LETSENCRYPT_HOST}
- TZ=${TZ}
volumes:
- ./src:/usr/share/nginx/html
networks:
nginx-proxy:
api_internal:
depends_on:
- nibiru-auth-api
restart: always
nibiru-webhook-receiver:
build:
context: ./nibiru-webhook-receiver/fpm
env_file:
- .env
environment:
- APPLICATION_ENV=${APPLICATION_ENV}
- VIRTUAL_HOST=${NIBIRU_WEHOOK_RECEIVER_VIRTUAL_HOST}
- VIRTUAL_PORT=${FPM_VIRTUAL_PORT}
- NIBIRU_WEHOOK_RECEIVER_VIRTUAL_HOST=${NIBIRU_WEHOOK_RECEIVER_VIRTUAL_HOST}
- NIBIRU_WEBHOOK_HOST=${NIBIRU_WEBHOOK_HOST}
- TZ=${TZ}
volumes:
- ./src:/var/www/html
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php-fpm
networks:
- nginx-proxy
api_internal:
restart: always
nibiru-webhook-receiver-nginx:
build:
context: ./nibiru-webhook-receiver/nginx
links:
- nibiru-webhook-receiver
env_file:
- .env
environment:
- APPLICATION_ENV=${APPLICATION_ENV}
- VIRTUAL_HOST=${NIBIRU_WEHOOK_RECEIVER_VIRTUAL_HOST}
- VIRTUAL_PORT=${NGINX_PROXY_VIRTUAL_PORT}
- FPM_VIRTUAL_PORT=${FPM_VIRTUAL_PORT}
- LETSENCRYPT_HOST=${NIBIRU_WEHOOK_RECEIVER_LETSENCRYPT_HOST}
- TZ=${TZ}
volumes:
- ./src:/usr/share/nginx/html
networks:
nginx-proxy:
api_internal:
depends_on:
- nibiru-auth-api
restart: always
networks:
nginx-proxy:
external: true
api_internal:
external: true