-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This documents our setup for running both ubyssey.ca and thoth.ubyssey.ca as isolated apps on a single Docker Swarm VM:
- Separate Compose Files:
/opt/ubyssey.ca/docker-compose.ymlfor ubyssey/opt/thoth/docker-compose.ymlfor thoth
- Separate Swarm Stacks:
- Deploy with
docker stack deploy -c /opt/ubyssey.ca/docker-compose.yml ubyssey - Deploy with
docker stack deploy -c /opt/thoth/docker-compose.yml thoth
- Deploy with
- Shared Overlay Network:
docker network create --driver=overlay proxy-shared
- Service Attachment:
- Both compose files reference
proxy-sharedand attach services that need to communicate (e.g., nginx, thothbackend, thothfrontend)
- Both compose files reference
- Single Public Entrypoint (Nginx):
- Nginx runs in the ubyssey stack
- Handles routing for ubyssey.ca and thoth.ubyssey.ca
- Reverse proxies requests via the shared network to appropriate backend containers
- CI/CD Isolation:
- Deployments for each app only update their own stack
- No cross-deployment: ubyssey repo only deploys ubyssey stack, thoth repo only deploys thoth stack
This ensures clean separation, security, and control over deployments for each app.
Implementation To-Do:
- Create a new branch in thoth-frontend for CI improvements
- Integrate the following GitHub Actions steps to trigger deployment in thoth:
- name: Create a GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ubyssey
repositories: thoth
- name: Trigger deploy-production workflow in thoth
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
curl -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/ubyssey/thoth/actions/workflows/deploy-production.yml/dispatches \
-d '{"ref":"1-run-ubysseyca-and-thothubysseyca-as-isolated-apps-on-docker-swarm-vm"}'- Commit and test the workflow integration.
- Document the changes in the repository.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request