mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-21 23:18:12 -07:00
feat(deploy): Introduce Docker Compose configuration for multi-world deployment
- Separate web service into two containers, one for main process and one for gunicorn - Update container configurations for improved security and maintainability - Remove unused volumes and network configurations
This commit is contained in:
committed by
Adrian Priestley
parent
d80d297d97
commit
b07a0a7c28
@@ -1,36 +1,58 @@
|
||||
services:
|
||||
web:
|
||||
multiworld:
|
||||
# Build only once. Web service uses the same image build
|
||||
build:
|
||||
context: ..
|
||||
entrypoint: >
|
||||
sh -c "python WebHost.py --config_override selflaunch.yaml & gunicorn -c gunicorn.conf.py"
|
||||
# Name image for use in web service
|
||||
image: archipelago-base
|
||||
# Use locally-built image
|
||||
pull_policy: never
|
||||
# Launch main process without website hosting (config override)
|
||||
entrypoint: python WebHost.py --config_override selflaunch.yaml
|
||||
volumes:
|
||||
- static_volume:/app/WebHostLib
|
||||
- output_volume:/app/output
|
||||
- sprites_alttpr_volume:/app/sprites/alttpr
|
||||
- sprites_custom_volume:/app/sprites/custom
|
||||
# Mount application volume
|
||||
- app_volume:/app
|
||||
|
||||
# Mount configs
|
||||
- ./example_config.yaml:/app/config.yaml
|
||||
- ./example_selflaunch.yaml:/app/selflaunch.yaml
|
||||
|
||||
# Expose on host network for access to dynamically mapped ports
|
||||
network_mode: host
|
||||
|
||||
web:
|
||||
# Use image build by multiworld service
|
||||
image: archipelago-base
|
||||
# Use locally-built image
|
||||
pull_policy: never
|
||||
# Launch gunicorn targeting WebHost application
|
||||
entrypoint: gunicorn -c gunicorn.conf.py
|
||||
volumes:
|
||||
# Mount application volume
|
||||
- app_volume:/app
|
||||
|
||||
# Mount configs
|
||||
- ./example_config.yaml:/app/config.yaml
|
||||
- ./example_gunicorn.conf.py:/app/gunicorn.conf.py
|
||||
environment:
|
||||
#Bind gunicorn to 0.0.0.0:8000
|
||||
# Bind gunicorn on 8000
|
||||
- PORT=8000
|
||||
network_mode: host
|
||||
|
||||
nginx:
|
||||
image: nginx:stable-alpine
|
||||
volumes:
|
||||
- static_volume:/app/WebHostLib
|
||||
# Mount application volume
|
||||
- app_volume:/app
|
||||
|
||||
# Mount config
|
||||
- ./example_nginx.conf:/etc/nginx/nginx.conf
|
||||
ports:
|
||||
# Nginx listening internally on port 80 -- mapped to 8080 on host
|
||||
- 8080:80
|
||||
depends_on:
|
||||
- web
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
volumes:
|
||||
static_volume:
|
||||
output_volume:
|
||||
sprites_alttpr_volume:
|
||||
sprites_custom_volume:
|
||||
# Share application directory amongst multiworld and web services
|
||||
# (for access to log files and the like), and nginx (for static files)
|
||||
app_volume:
|
||||
|
||||
@@ -5,5 +5,5 @@ SELFHOST: false
|
||||
SELFLAUNCH: false
|
||||
|
||||
# Host Address. This is the address encoded into the patch that will be used for client auto-connect.
|
||||
# Set as your local IP to serve over LAN.
|
||||
# Set as your local IP (192.168.x.x) to serve over LAN.
|
||||
HOST_ADDRESS: localhost
|
||||
|
||||
@@ -28,7 +28,7 @@ http {
|
||||
# server unix:/tmp/gunicorn.sock fail_timeout=0;
|
||||
|
||||
# for a TCP configuration
|
||||
server host.docker.internal:8000 fail_timeout=0;
|
||||
server web:8000 fail_timeout=0;
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
Reference in New Issue
Block a user