feat: add traefik config

This commit is contained in:
Niklas 2023-10-29 19:01:01 +01:00
parent ed46d10393
commit ad7fc4141e
5 changed files with 67 additions and 2 deletions

View File

5
.env
View File

@ -1,3 +1,8 @@
# See notes for traefik in README
TRAEFIK_VIRTUAL_HOST_ASSETS=assets.example.com
TRAEFIK_VIRTUAL_HOST_NITRO=game.example.com
TRAEFIK_VIRTUAL_HOST_CMS=example.com
MYSQL_ROOT_PASSWORD=arcturus_root_pw
MYSQL_USER=arcturus_user
MYSQL_PASSWORD=arcturus_pw

View File

@ -10,6 +10,16 @@ The default configuration can run on localhost.
- Node.js LTS or higher (For the habbo-downloader)
- Clone this repository
## Notes
This setup installs a complete local setup. Connecting externally requires editing the configurations. Serach for the following ports and edit them. Down below is a recommended domain setup when using reverse proxies like traefik.
| Server | Local Setup | Recommended Domain Setup |
|-----------------------|-----------------------|--------------------------|
| MorningStar WebSocket | ws://127.0.0.1:2096 | game.example.com |
| Assets Server | http://127.0.0.1:8080 | assets.example.com |
| CMS | http://127.0.0.1:8081 | example.com |
| Nitro Client | http://127.0.0.1:3080 | game.example.com |
## Build
1. Download the default assets
@ -177,7 +187,7 @@ docker compose restart arcturus
## AtomCMS
1. change [`.env.cms`](/.env.cms) to your needs
1. change [`.cms.env`](/.cms.env) to your needs
2. Check your permissions table. Use [**perms_groups.sql**](/arcturus/perms_groups.sql) if unclear. AtomCMS is not using the new permission layout so we are legacy supporting it by "copy" the most important values.

50
compose.traefik.yaml Normal file
View File

@ -0,0 +1,50 @@
services:
arcturus:
ports:
- "2096:2096"
nitro:
ports: []
networks: [nitro, traefik]
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.pixels-nitro.entrypoints=websecure"
- "traefik.http.routers.pixels-nitro.rule=Host(`$TRAEFIK_VIRTUAL_HOST_NITRO`)"
- "traefik.http.routers.pixels-nitro.service=pixels-nitro-srv"
- "traefik.http.services.pixels-nitro-srv.loadbalancer.server.port=80"
db:
ports: []
assets:
ports: []
networks: [nitro, traefik]
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.pixels-assets.entrypoints=websecure"
- "traefik.http.routers.pixels-assets.rule=Host(`$TRAEFIK_VIRTUAL_HOST_ASSETS`)"
- "traefik.http.routers.pixels-assets.service=pixels-assets-srv"
- "traefik.http.services.pixels-assets-srv.loadbalancer.server.port=80"
cms:
ports: []
networks: [nitro, traefik]
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.pixels-cms.entrypoints=websecure"
- "traefik.http.routers.pixels-cms.rule=Host(`$TRAEFIK_VIRTUAL_HOST_CMS`)"
- "traefik.http.routers.pixels-cms.service=pixels-cms-srv"
- "traefik.http.services.pixels-cms-srv.loadbalancer.server.port=80"
networks:
nitro:
traefik:
external: true

View File

@ -125,7 +125,7 @@ services:
ports:
- "8081:80"
volumes:
- ".env.cms:/var/www/html/.env"
- ".cms.env:/var/www/html/.env"
- "./atomcms/storage:/var/www/html/storage/app/public"
- "./atomcms/logs:/var/www/html/storage/logs"
networks: [nitro]