Last active
April 14, 2023 10:26
-
-
Save PlugFox/1c871549a953d63250d09a71850c6a79 to your computer and use it in GitHub Desktop.
Docker Stack for ChatGPT Web UI through Traefik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.9' | |
services: | |
chatgpt: | |
hostname: chatgpt | |
image: yidadaa/chatgpt-next-web:latest | |
networks: | |
- public # !!! REPLACE WITH YOUR TRAEFIK NETWORK !!! | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
environment: | |
- "TZ=UTC" | |
- "PORT=3000" | |
- "OPENAI_API_KEY=" # !!! YOUR CHAT GPT ACCESS TOKEN !!! | |
- "CODE=" # !!! YOUR CODES GOES HERE !!! | |
deploy: | |
mode: replicated | |
replicas: 1 | |
restart_policy: | |
condition: on-failure | |
placement: | |
constraints: | |
- node.role == manager | |
labels: | |
- org.label-schema.group=chatgpt | |
#################################################################### | |
# ChatGPT Web UI | |
#################################################################### | |
# Labels for traefik https://doc.traefik.io/traefik/providers/docker/ | |
- "traefik.enable=true" | |
- "traefik.http.routers.chatgpt.entrypoints=https" | |
- "traefik.http.routers.chatgpt.rule=Host(`domain.tld`)" # !!! YOUR DOMAIN GOES HERE !!! | |
- "traefik.http.routers.chatgpt.tls.certresolver=le" | |
# Port traefik needs to route traffic to | |
- "traefik.http.routers.chatgpt.service=chatgpt" | |
- "traefik.http.services.chatgpt.loadbalancer.server.port=3000" | |
# Enable middleware | |
- "traefik.http.routers.chatgpt.middlewares=chatgpt-ratelimit@docker" | |
# Middleware rate limit | |
- "traefik.http.middlewares.chatgpt-ratelimit.ratelimit.average=1000" | |
- "traefik.http.middlewares.chatgpt-ratelimit.ratelimit.burst=500" | |
networks: | |
# Overlay network for containers that need to be accessible over the internet | |
public: # !!! REPLACE WITH YOUR TRAEFIK NETWORK !!! | |
external: true | |
attachable: true | |
driver: overlay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment