-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set up the backend. With Traefik on Docker Swarm #257
Comments
I've adjusted the The errors might be because of ssl certificate not trusted on individual containers However it didn't fixed the issue of I've set every environment variable backend-server logs:
docker-compose.yml version: "3.7"
services:
chatgpt:
image: wongsaang/chatgpt-ui-client:latest
restart: unless-stopped
networks:
- web
- chatgpt
environment:
- SERVER_DOMAIN=http://backend-web-server
- PUID=1000
- PGID=1000
- DEBUG=True
- DEFAULT_LOCALE=en
- TZ=Europe/Warsaw
depends_on:
- chatgpt-backend-web
ports:
- '${CLIENT_PORT:-81}:80'
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.chatgpt.rule=Host(`chatgpt.home`) && PathPrefix(`/`)"
- "traefik.http.services.chatgpt.loadbalancer.server.port=80"
- "traefik.docker.network=web"
- "io.portainer.accesscontrol.users=admin"
- "traefik.http.routers.chatgpt.tls=true"
chatgpt-backend-wsgi:
image: wongsaang/chatgpt-ui-wsgi-server:latest
environment:
- APP_DOMAIN=${APP_DOMAIN:-localhost:9000}
- DEBUG=True
- SERVER_WORKERS=3 # The number of worker processes for handling requests.
# - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed.
- DJANGO_SUPERUSER_USERNAME=admin # default superuser name
- DJANGO_SUPERUSER_PASSWORD=password # default superuser password
- [email protected] # default superuser email
- ACCOUNT_EMAIL_VERIFICATION=${ACCOUNT_EMAIL_VERIFICATION:-none} # Determines the e-mail verification method during signup – choose one of "none", "optional", or "mandatory". Default is "optional". If you don't need to verify the email, you can set it to "none".
# If you want to use the email verification function, you need to configure the following parameters
# - EMAIL_HOST=SMTP server address
# - EMAIL_PORT=SMTP server port
# - EMAIL_HOST_USER=
# - EMAIL_HOST_PASSWORD=
# - EMAIL_USE_TLS=True
# - [email protected] #Default sender email address
volumes:
- /home/swarm/chatgpt/db.sqlite3:/app/db.sqlite3
networks:
- web
- chatgpt
restart: always
ports:
- '${WSGI_PORT:-8001}:8000'
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.chatgpt-backend-wsgi.rule=Host(`chatgpt-backend-wsgi.home`) && PathPrefix(`/`)"
- "traefik.http.services.chatgpt-backend-wsgi.loadbalancer.server.port=8000"
- "traefik.docker.network=web"
- "io.portainer.accesscontrol.users=admin"
- "traefik.http.routers.chatgpt-backend-wsgi.tls=true"
chatgpt-backend-web:
image: wongsaang/chatgpt-ui-web-server:latest
environment:
- BACKEND_URL=http://backend-wsgi-server:8000
- DEBUG=True
depends_on:
- chatgpt-backend-wsgi
networks:
- web
- chatgpt
restart: always
ports:
- '${SERVER_PORT:-9001}:80'
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.chatgpt-backend-web.rule=Host(`chatgpt-backend-web.home`) && PathPrefix(`/`)"
- "traefik.http.services.chatgpt-backend-web.loadbalancer.server.port=9000" # In Dockerfile the port that is EXPOSEd is 80
- "traefik.docker.network=web"
- "io.portainer.accesscontrol.users=admin"
- "traefik.http.routers.chatgpt-backend-web.tls=true"
networks:
chatgpt:
driver: bridge
attachable: true
name: chatgpt
web:
external: true
name: web
volumes:
chatgpt-volume:
driver: local
|
When I just use the pre-downloaded docker-compose.yml
Backend runs smoothly, docker-compose.yml
$ wget https://api.openai.com --2024-01-10 21:41:43-- https://api.openai.com/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving api.openai.com (api.openai.com)... 104.18.7.192, 104.18.6.192
Connecting to api.openai.com (api.openai.com)|104.18.7.192|:443... connected.
HTTP request sent, awaiting response... 421 Misdirected Request
2024-01-10 21:41:43 ERROR 421: Misdirected Request. wsgi logs:
backend-server
|
I've followed the documentation and tweaked docker-compose.yml to be compatible with Docker Swarm and also Traefik routing
However, I still encounter issues going to
https://wsgi-backend
andhttps://server-backend
On wsgi I get page
404
, on server-backend I getBad Gateway
(because in the Docker EXPOSE 80 is specified)If there are any other files/logs I can provide let me know
docker-compose.yml
chatgpt-client logs:
chatgpt-wsgi:
chatgpt-backend-server:
The text was updated successfully, but these errors were encountered: