-
I thought I'd share my compose, in case you'd want to add that to your docs - specifically the CORS section. full compose: plantit-fe:
image: msdeluise/plant-it-frontend:latest
container_name: plantit-fe
restart: unless-stopped
networks:
reverse_proxy:
internal:
# ipv4_address: ${PLANTIT_FE_IP}
# ports:
# - 3000:3000
environment:
- PORT=3000
- API_URL=https://plantit.${DOMAINNAME0}/api
- WAIT_TIMEOUT=10000 # backend response timeout in ms
- PAGE_SIZE=25
- BROWSER=none
labels:
# Traefik
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.plantit-rtr.entrypoints=https"
- "traefik.http.routers.plantit-rtr.rule=Host(`plantit.${DOMAINNAME0}`)"
## Middlewares
- "traefik.http.routers.plantit-rtr.middlewares=chain-authelia@file"
## HTTP Services
- "traefik.http.routers.plantit-rtr.service=plantit-svc"
- "traefik.http.services.plantit-svc.loadbalancer.server.port=3000"
plantit-be:
image: msdeluise/plant-it-backend:latest
container_name: plantit-be
restart: unless-stopped
depends_on:
- plantit-db
- plantit-cache
networks:
reverse_proxy:
internal:
# ipv4_address: ${PLANTIT_BE_IP}
# ports:
# - 8080:8080
volumes:
- $DOCKERDIR/appdata/plantit/upload-dir:/upload-dir
environment:
- MYSQL_HOST=plantit-db
- MYSQL_PORT=3306
- MYSQL_DATABASE=${PLANTIT_DB_NAME}
- MYSQL_USERNAME=${PLANTIT_DB_USER}
- MYSQL_PSW=${PLANTIT_DB_ROOT}
- MYSQL_ROOT_PASSWORD=${PLANTIT_DB_ROOT}
- CACHE_HOST=plantit-cache
- CACHE_TTL=86400
- CACHE_PORT=6379
- API_PORT=8080
- JWT_SECRET=<redacted>
- JWT_EXP=1
- USERS_LIMIT=-1 # less then 0 means no limit
- UPLOAD_DIR=/upload-dir
- TREFLE_KEY=<redacted>
# - ALLOWED_ORIGINS=http://${PLANTIT_FE_IP}:3000
- ALLOWED_ORIGINS=https://plantit.${DOMAINNAME0}:3000
- LOG_LEVEL=INFO # DEBUG, INFO, WARN, ERROR
labels:
# Traefik
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.plantit-api-rtr.entrypoints=https"
- "traefik.http.routers.plantit-api-rtr.rule=Host(`plantit.$DOMAINNAME0`) && (PathPrefix(`/api`))"
## Middlewares
- "traefik.http.routers.plantit-api-rtr.middlewares=plantit-cors@docker,chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.plantit-api-rtr.service=plantit-api-svc"
- "traefik.http.services.plantit-api-svc.loadbalancer.server.port=8080"
## CORS
- "traefik.http.middlewares.plantit-cors.headers.customResponseHeaders.Access-Control-Allow-Origin=https://plantit.${DOMAINNAME0}"
plantit-db:
image: mysql:8.0
container_name: plantit-db
restart: unless-stopped
networks:
- internal
volumes:
- $DOCKERDIR/appdata/plantit-db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${PLANTIT_DB_ROOT}
plantit-cache:
image: redis:7.2.1
container_name: plantit-cache
restart: unless-stopped
networks:
- internal |
Beta Was this translation helpful? Give feedback.
Answered by
MDeLuise
Feb 12, 2024
Replies: 1 comment 2 replies
-
Hi @filcuk, thanks for sharing your setup. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
filcuk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @filcuk, thanks for sharing your setup.
I appreciate you taking the time to contribute. I'll definitely add this to the documentation. Thanks again for your input!