diff --git a/README.md b/README.md index 2589aa7..fe9e756 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,13 @@ https://www.youtube.com/watch?v=cCmnw-pq0gA You only need `.env.example`, `docker-compose.yml` and `traefik/`. -You don't need to have traefik as your entrypoint reverse proxy. In that case you can use `docker-compose.http.yml` that will expose this service to `APP_PORT`. +#### Do I need to use traefik? + +- Traefik needs to be used to forward traffic to the rooms. You can put nginx in front of it, but not replace it. +- Your domain name specified for traefik must match domain name, that your proxy connects to. +- Currently, there is no support for custom paths. You cannot host your `neko-rooms` on `example.com/neko-rooms/` but it needs own subdomain e.g. `neko-rooms.example.com`. + +You can use `docker-compose.http.yml` that will expose this service to `APP_PORT`. See example configuration for [nginx](docs/nginx). ### Step 1 diff --git a/docs/nginx/docker-compose.yml b/docs/nginx/docker-compose.yml new file mode 100644 index 0000000..f208250 --- /dev/null +++ b/docs/nginx/docker-compose.yml @@ -0,0 +1,54 @@ +version: "3.7" + +networks: + default: + attachable: "true" + name: "neko-rooms-traefik" + +services: + traefik: # traefik domain (name of the service) + image: "traefik:2.4" + restart: "unless-stopped" + environment: + - "TZ=Europe/Vienna" + command: + - "--providers.docker=true" + - "--providers.docker.watch=true" + - "--providers.docker.exposedbydefault=false" + - "--providers.docker.network=neko-rooms-traefik" + - "--entrypoints.web.address=:8080" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + + neko-rooms: + image: "m1k1o/neko-rooms:latest" + restart: "unless-stopped" + environment: + - "TZ=Europe/Vienna" + - "NEKO_ROOMS_EPR=59000-59049" + - "NEKO_ROOMS_NAT1TO1=10.8.0.1" # IP address of your server + - "NEKO_ROOMS_TRAEFIK_DOMAIN=traefik" # traefik domain (name of the service) + - "NEKO_ROOMS_TRAEFIK_ENTRYPOINT=web" + - "NEKO_ROOMS_TRAEFIK_NETWORK=neko-rooms-traefik" + - "NEKO_ROOMS_INSTANCE_URL=https://10.8.0.1:8080/" # external URL + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + labels: + - "traefik.enable=true" + - "traefik.http.services.neko-rooms-frontend.loadbalancer.server.port=8080" + - "traefik.http.routers.neko-rooms.entrypoints=web" + - "traefik.http.routers.neko-rooms.rule=Host(`traefik`)" # traefik domain (name of the service) + + # + # This should be replaced by your own existing nginx instance + # + + nginx: + image: "nginx" + restart: "unless-stopped" + environment: + - "TZ=Europe/Vienna" + ports: + - "8080:80" + volumes: + - "./nginx.conf:/etc/nginx/conf.d/default.conf:ro" diff --git a/docs/nginx/nginx.conf b/docs/nginx/nginx.conf new file mode 100644 index 0000000..3a22f13 --- /dev/null +++ b/docs/nginx/nginx.conf @@ -0,0 +1,7 @@ +server { + listen 80; + + location / { + proxy_pass http://traefik:8080; # traefik domain (name of the service) + } +}