Update Docker Compose configs

This commit is contained in:
Matt Isenhower
2024-11-14 22:00:09 -08:00
parent 5951d7e4a4
commit e140657ce2
5 changed files with 34 additions and 89 deletions

View File

@@ -0,0 +1,14 @@
# Example Docker Compose override file for local development
services:
app:
platform: linux/amd64 # Needed for Apple Silicon
build:
dockerfile: docker/app/Dockerfile
volumes:
- .:/app
browserless:
platform: linux/arm64 # Needed for Apple Silicon
ports:
- 3000:3000

View File

@@ -1,20 +0,0 @@
version: '2'
# This adds config options for use with nginx-proxy:
# https://github.com/jwilder/nginx-proxy
# Alternatively, a public port for nginx could be exposed here.
services:
nginx:
environment:
VIRTUAL_HOST: splatoon2.ink,www.splatoon2.ink
networks:
- default
- nginx-proxy
networks:
nginx-proxy:
external:
name: nginxproxy_default

View File

@@ -0,0 +1,17 @@
# Example Docker Compose override file for production
services:
app:
# Use a different tag if needed
# image: ghcr.io/misenhower/splatoon2.ink:develop
labels: [ "com.centurylinklabs.watchtower.scope=devsplatoon2ink" ]
browserless:
labels: [ "com.centurylinklabs.watchtower.scope=devsplatoon2ink" ]
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 30 --scope devsplatoon2ink
labels: [ "com.centurylinklabs.watchtower.scope=devsplatoon2ink" ]

View File

@@ -1,7 +1,6 @@
services:
app:
build:
dockerfile: docker/app/Dockerfile
image: ghcr.io/misenhower/splatoon2.ink
init: true
restart: unless-stopped
environment:
@@ -10,16 +9,11 @@ services:
SCREENSHOT_HOST: app
depends_on:
- browserless
env_file:
- .env
browserless:
image: ghcr.io/browserless/chromium
restart: unless-stopped
environment:
CONCURRENT: ${BROWSERLESS_CONCURRENT:-1}
nginx:
image: nginx
restart: unless-stopped
volumes:
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- ./dist:/usr/share/nginx/html:ro

View File

@@ -1,60 +0,0 @@
# Rate limiting zone (Note: 10m is the size of the address pool, not time)
limit_req_zone $binary_remote_addr zone=main:10m rate=10r/s;
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.html;
charset utf-8;
charset_types application/json;
# Docker reverse proxy IP passthrough
set_real_ip_from 172.16.0.0/12;
real_ip_header X-Real-IP;
# Log to the main (Docker stdout) log
access_log /var/log/nginx/access.log;
# Rate limiting: allow bursts with no delay
limit_req zone=main burst=500 nodelay;
location / {
try_files $uri $uri/ /index.html;
}
# Force browsers to check for updated data
location /data/ {
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
autoindex on;
}
location /twitter-images/ {
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
location ~ \.ics$ {
add_header Content-Type text/calendar;
}
# CORS (for modern ES module support and third-party integrations)
location /assets/ {
add_header Access-Control-Allow-Origin *;
}
# Block access to the file used for screenshots
location = /screenshots.html {
internal;
}
}
# Redirect www to non-www
server {
listen 80;
server_name www.splatoon2.ink;
return 301 $scheme://splatoon2.ink$request_uri;
}