Refactor Docker Compose configurations and add Unraid support
- Update docker-compose files for dev, local, and prod environments - Improve service definitions and environment variable handling - Add Unraid-specific Docker Compose and environment files - Remove deprecated .env.example and dockercomposeforserver.yml - Streamline configuration management across environments
This commit is contained in:
40
.env.example
40
.env.example
@@ -1,40 +0,0 @@
|
||||
# EAMCO Environment Variables
|
||||
# Copy this file to .env and fill in actual values
|
||||
# NEVER commit .env to version control
|
||||
|
||||
# ===========================================
|
||||
# Database Credentials (All Services)
|
||||
# ===========================================
|
||||
POSTGRES_USERNAME=postgres
|
||||
POSTGRES_PW=your_password_here
|
||||
POSTGRES_SERVER=192.168.1.204
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_DBNAME=auburnoil
|
||||
|
||||
# ===========================================
|
||||
# Flask Secret Key (eamco_office_api)
|
||||
# ===========================================
|
||||
# Generate with: python -c "import secrets; print(secrets.token_hex(32))"
|
||||
SECRET_KEY=your_secret_key_here
|
||||
|
||||
# ===========================================
|
||||
# Authorize.net API Credentials
|
||||
# ===========================================
|
||||
# Production credentials (used by LOCAL and PRODUCTION modes)
|
||||
AUTHORIZE_API_LOGIN_ID=your_api_login_id_here
|
||||
AUTHORIZE_TRANSACTION_KEY=your_transaction_key_here
|
||||
|
||||
# Development/Sandbox credentials (used by DEVELOPMENT mode)
|
||||
AUTHORIZE_API_LOGIN_ID_DEV=your_sandbox_api_login_id_here
|
||||
AUTHORIZE_TRANSACTION_KEY_DEV=your_sandbox_transaction_key_here
|
||||
|
||||
# ===========================================
|
||||
# VoIP.ms Credentials (eamco_voipms)
|
||||
# ===========================================
|
||||
VOIPMS_API_USERNAME=your_voipms_username
|
||||
VOIPMS_API_PASSWORD=your_voipms_password
|
||||
TARGET_DID=your_did_number
|
||||
TARGET_SIP_ACCOUNT=your_sip_account
|
||||
TARGET_CELLPHONE_1=your_cellphone_1
|
||||
TARGET_CELLPHONE_2=your_cellphone_2
|
||||
VOIPMS_API_URL=https://voip.ms/api/v1/rest.php
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
name: eamco
|
||||
services:
|
||||
|
||||
@@ -14,7 +12,6 @@ services:
|
||||
- '9510:4056'
|
||||
command: 'python3 app.py --host 0.0.0.0'
|
||||
|
||||
|
||||
frontend_office_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -26,7 +23,6 @@ services:
|
||||
- '9511:5173'
|
||||
command: 'vite dev --host --port 5173'
|
||||
|
||||
|
||||
money_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -38,7 +34,6 @@ services:
|
||||
- '9513:8000'
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
auto_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -50,7 +45,16 @@ services:
|
||||
- '9514:8000'
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
service_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
context: ../eamco_service
|
||||
dockerfile: Dockerfile.dev
|
||||
volumes:
|
||||
- ../eamco_service:/app
|
||||
ports:
|
||||
- '9515:8000'
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
playground_dev:
|
||||
restart: on-failure
|
||||
@@ -63,10 +67,6 @@ services:
|
||||
- '9520:8000'
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
authorize_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -76,6 +76,8 @@ services:
|
||||
- ../eamco_authorize:/app
|
||||
ports:
|
||||
- '9516:8000'
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- MODE=DEVELOPMENT
|
||||
- AUTHORIZE_API_LOGIN_ID_DEV=${AUTHORIZE_API_LOGIN_ID_DEV}
|
||||
@@ -86,7 +88,6 @@ services:
|
||||
- POSTGRES_DBNAME=eamco
|
||||
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
voipms_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -98,7 +99,6 @@ services:
|
||||
- '9517:8000'
|
||||
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
address_checker_dev:
|
||||
restart: on-failure
|
||||
build:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
name: eamco
|
||||
services:
|
||||
|
||||
@@ -55,6 +54,21 @@ services:
|
||||
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
service_local:
|
||||
restart: on-failure
|
||||
build:
|
||||
context: ../eamco_service
|
||||
dockerfile: Dockerfile.local
|
||||
ports:
|
||||
- '9615:8000'
|
||||
environment:
|
||||
- MODE=LOCAL
|
||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
||||
- POSTGRES_PW=${POSTGRES_PW}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
|
||||
command: 'uvicorn main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
authorize_local:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -66,8 +80,6 @@ services:
|
||||
- '9616:8000'
|
||||
environment:
|
||||
- MODE=LOCAL
|
||||
- AUTHORIZE_API_LOGIN_ID=${AUTHORIZE_API_LOGIN_ID}
|
||||
- AUTHORIZE_TRANSACTION_KEY=${AUTHORIZE_TRANSACTION_KEY}
|
||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
||||
- POSTGRES_PW=${POSTGRES_PW}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
name: eamco
|
||||
services:
|
||||
|
||||
@@ -8,7 +7,6 @@ services:
|
||||
context: ../eamco_office_frontend
|
||||
dockerfile: Dockerfile.prod
|
||||
|
||||
|
||||
backend_office_prod:
|
||||
restart: always
|
||||
build:
|
||||
@@ -54,6 +52,21 @@ services:
|
||||
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
service_prod:
|
||||
restart: on-failure
|
||||
build:
|
||||
context: ../eamco_service
|
||||
dockerfile: Dockerfile.prod
|
||||
ports:
|
||||
- '9515:8000'
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
||||
- POSTGRES_PW=${POSTGRES_PW}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
authorize_prod:
|
||||
restart: on-failure
|
||||
build:
|
||||
@@ -65,8 +78,6 @@ services:
|
||||
- '9516:8000'
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
- AUTHORIZE_API_LOGIN_ID=${AUTHORIZE_API_LOGIN_ID}
|
||||
- AUTHORIZE_TRANSACTION_KEY=${AUTHORIZE_TRANSACTION_KEY}
|
||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
||||
- POSTGRES_PW=${POSTGRES_PW}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
@@ -103,5 +114,9 @@ services:
|
||||
dockerfile: Dockerfile.prod
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
|
||||
- POSTGRES_PW=${POSTGRES_PW}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
|
||||
ports:
|
||||
- '9518:8000'
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# 'version' attribute is removed as it's obsolete.
|
||||
# 'name' attribute is also managed by Compose Manager, so we can remove it.
|
||||
|
||||
services:
|
||||
|
||||
frontend_office_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-frontend_office_prod:latest
|
||||
ports:
|
||||
- '9511:80'
|
||||
|
||||
backend_office_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-backend_office_prod:latest
|
||||
ports:
|
||||
- '9510:80'
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
|
||||
auto_service_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-auto_prod:latest
|
||||
ports:
|
||||
- '9514:8000'
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000'
|
||||
|
||||
money_service_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-money_service_prod:latest
|
||||
ports:
|
||||
- '9513:8000'
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
authorize_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-authorize_prod:latest
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
ports:
|
||||
- '9516:8000'
|
||||
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
|
||||
voipms_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-voipms_prod:latest
|
||||
environment:
|
||||
- MODE=PRODUCTION
|
||||
ports:
|
||||
- '9517:8000'
|
||||
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
|
||||
71
unraid-docker-compose.yml
Normal file
71
unraid-docker-compose.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
|
||||
frontend_office_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-frontend_office_prod:latest
|
||||
ports:
|
||||
- '9511:80'
|
||||
env_file:
|
||||
- unraid-env
|
||||
|
||||
backend_office_prod:
|
||||
restart: always
|
||||
image: anekdotin/eamco-backend_office_prod:latest
|
||||
ports:
|
||||
- '9510:80'
|
||||
env_file:
|
||||
- unraid-env
|
||||
|
||||
money_service_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-money_service_prod:latest
|
||||
ports:
|
||||
- '9513:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
auto_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-auto_prod:latest
|
||||
ports:
|
||||
- '9514:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
service_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-service_prod:latest
|
||||
ports:
|
||||
- '9515:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
command: 'uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
authorize_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-authorize_prod:latest
|
||||
ports:
|
||||
- '9516:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
command: 'uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
voipms_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-voipms_prod:latest
|
||||
ports:
|
||||
- '9517:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
command: 'uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2'
|
||||
|
||||
address_checker_prod:
|
||||
restart: on-failure
|
||||
image: anekdotin/eamco-address_checker_prod:latest
|
||||
ports:
|
||||
- '9518:8000'
|
||||
env_file:
|
||||
- unraid-env
|
||||
51
unraid-env
Normal file
51
unraid-env
Normal file
@@ -0,0 +1,51 @@
|
||||
# Unraid Environment Configuration
|
||||
# ===========================================
|
||||
# General
|
||||
# ===========================================
|
||||
MODE="PRODUCTION"
|
||||
PYTHONUNBUFFERED=1
|
||||
PYTHONFAULTHANDLER=1
|
||||
|
||||
# ===========================================
|
||||
# URLs
|
||||
# ===========================================
|
||||
# Pointing to the backend office API
|
||||
VITE_BASE_URL="http://192.168.1.204:9510"
|
||||
VITE_MONEY_URL="http://192.168.1.204:9513"
|
||||
VITE_AUTO_URL="http://192.168.1.204:9514"
|
||||
VITE_SERVICE_URL="http://192.168.1.204:9515"
|
||||
VITE_AUTHORIZE_URL="http://192.168.1.204:9516"
|
||||
VITE_ADDRESS_CHECKER_URL="http://192.168.1.204:9518"
|
||||
|
||||
# ===========================================
|
||||
# Database Credentials
|
||||
# ===========================================
|
||||
# POSTGRES_SERVER is set to your Unraid IP
|
||||
POSTGRES_USERNAME=postgres
|
||||
POSTGRES_PW=password
|
||||
POSTGRES_SERVER=192.168.1.204
|
||||
POSTGRES_DBNAME=auburnoil
|
||||
|
||||
# ===========================================
|
||||
# Authorize.net
|
||||
# ===========================================
|
||||
# Production credentials found in eamco_deploy/.env
|
||||
AUTHORIZE_API_LOGIN_ID=4d2Mn6H23R
|
||||
AUTHORIZE_TRANSACTION_KEY=7B94d8xfTQXv37WS
|
||||
|
||||
# ===========================================
|
||||
# VoIP.ms
|
||||
# ===========================================
|
||||
# Credentials found in eamco_voipms/.env
|
||||
VOIPMS_API_USERNAME=eddwinn@gmail.com
|
||||
VOIPMS_API_PASSWORD=!Gofionago123catdog
|
||||
TARGET_DID=5084268800
|
||||
TARGET_SIP_ACCOUNT=407323_auburnoil@washington2.voip.ms
|
||||
TARGET_CELLPHONE_1=7743342638
|
||||
TARGET_CELLPHONE_2=9143306100
|
||||
|
||||
# ===========================================
|
||||
# Flask Secret Key
|
||||
# ===========================================
|
||||
# Generated for this deployment
|
||||
SECRET_KEY=174ac9a094b957fdb8081c334439f92523c1b4887b59c63d92e4b6c33354445f
|
||||
Reference in New Issue
Block a user