Replies: 2 comments 1 reply
-
|
It should be somewhat easy to do using traefik as a reverse proxy. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Here's an example services:
ghost1:
image: ghost:5-alpine
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.ghost1.rule=Host(`ghost1.localhost`)"
- "traefik.http.routers.ghost1.entrypoints=web"
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost1
# this url value is just an example, and is likely wrong for your environment!
url: http://ghost1.localhost
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
#NODE_ENV: development
volumes:
- ghost:/var/lib/ghost/content
ghost2:
image: ghost:5-alpine
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.ghost2.rule=Host(`ghost2.localhost`)"
- "traefik.http.routers.ghost2.entrypoints=web"
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost2
# this url value is just an example, and is likely wrong for your environment!
url: http://ghost2.localhost
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
#NODE_ENV: development
volumes:
- ghost:/var/lib/ghost/content
traefik:
image: "traefik:v2.11"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
db:
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- db:/var/lib/mysql
volumes:
ghost:
db: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
While I understand that Ghost is not multi-tenant, I am still looking for ways to host multiple independent blogs on the same server.
I recently found this guide on creating virtual hosts on an apache server https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04, and was thinking if anyone has tried that in combination with multiple ghost docker images?
Beta Was this translation helpful? Give feedback.
All reactions