2
0
Fork
You've already forked infra
0
Docker infrastructure for development and production
  • Dockerfile 100%
2026年03月22日 16:37:41 +01:00
docker proxy: update Caddy from 2.8 to 2.11 2026年03月02日 15:44:10 +01:00
env env: add restart unless-stopped for lxup-website 2026年03月22日 15:21:59 +01:00
imgs readme: add WIP infra overview diagram 2024年06月29日 18:13:34 +02:00
schemas docs: save infra-overview schemas with dev env 2026年01月22日 00:11:31 +01:00
.gitignore docs: save infra-overview schemas with dev env 2026年01月22日 00:11:31 +01:00
README.md docker: refactor common deps into base.Dockerfile, add website Dockerfile.dev 2026年01月22日 01:42:18 +01:00

infra - Docker infrastructure for development and production

Docker infrastructure overview schema

Incomplete but useful diagram of the infrastructure

Development infra

Here are the minimal steps to install a fully working development environment, that let you play with Delibay locally and start coding. It is working with a delibay.local domain that you configure to point locally. It is only using host ports 80 and 443. Each service is hosted on a given subdomain. The frontend is at app.delibay.local.

  1. Clone all Git repositories under a dev folder and create a state folder under dev/state
    git clone https://codeberg.org/delibay/infra.git
    cd infra
    mkdir dev dev/state && cd dev
    git clone https://codeberg.org/delibay/frontend.git
    git clone https://codeberg.org/delibay/backend.git
    git clone https://codeberg.org/delibay/delibay.org.git
    git clone https://codeberg.org/delibay/project.git
    cd ..
    
  2. Build all docker images, juste once
    docker build --network host . -f docker/base.Dockerfile -t delibay-dev/base # base development image
    cd infra/env
    docker compose -f dev.yml build
    
  3. Define these host names in your /etc/hosts or C:\Windows\System32\hosts as administrator. These allows to resolve these domains as the local environment, even if the domain doesn't really exist.
    127.0.0.1 delibay.local
    127.0.0.1 backend.delibay.local
    127.0.0.1 app.delibay.local
    127.0.0.1 git.delibay.local
    127.0.0.1 mail.delibay.local
    
  4. Setup forgejo servers with admin account on https://git.kaizen.local.
    docker compose -f dev.yml up
    
  5. Backend and frontend will automatically start some scripts to install dependencies and start development servers.

Users and Credentials

When the backend container starts, it initialized the database with a few elements, to avoid making them manually.

  • All users have the password pwd for ease of development
  • One organisation named DeliSchool has been created and the following users have joined it
    • 2 teachers: teacher1@delibay.org and teacher2@delibay.org
    • 10 students: student1@delibay.org, student2@delibay.org, ... student10@delibay.org.

How to use the infra ?

Make sure you visit all domains before using them to have clicked "Trust this self-signed certificate".

  1. Visit https://delibay.local to view the delibay.org website, showing content from the project repository cloned at dev/project.
  2. Visit https://backend.delibay.local to see the backend running based on the backend repository cloned at dev/backend.
  3. Visit https://app.delibay.local to view the frontend, showing content from the frontend repository cloned at dev/frontend.
  4. Visit https://git.delibay.local to access a local Git server using Forgejo. You can setup a root account and user account if you want to deploy courses only locally.
  5. Visit https://mail.delibay.local to access a fake mail server called maildev.

Quick wins

Once you opened all these domains and everything is working, here are a few steps to show how technically easy it is to contribute.

Changing some documentation pages

  1. Open the documentation pages on https://delibay.local, choose one page at left in the list.
  2. Open dev/project and search for the associated Markdown file. Hint: It has the same name as the route.
  3. Open this file and add a creative paragraph somewhere.
  4. Make sure to hit save and reload the page in your browser. The change should be visible !

Deploying a public course from GitHub

  1. Login as a teacher: take email teacher1@delibay.org, password pwd and backend URL backend.delibay.local.
  2. You should be logged in and but there is no course. This is expected !
  3. Choose a course from the list or pick other you know
  4. Open its URL and take the SSH link.
  5. Click on Deploy course and use the SSH link
  6. The course should be deployed and it should be listed under the Courses list.
  7. You can open it and try a few exos to make sure it works.

Production infra

Install the VPS

See draft in vps

Generate and manage secrets in .env

Generate a BETABACKEND_APP_KEY https://dev.to/gregorip02/how-generate-a-laravel-appkey-with-openssl-4cpe

echo "base64:$(openssl rand -base64 32)"

TODO: check the security of the randomness and check the length choice

Manage server rules

TODO

Post start scripts

TODO: Start the infrastructure in background docker compose up -d. The Laravel apps should finish their setup themself at this moment (run database migrations, run key generation, and finally setup in up mode (php artisan up)).

Generate backups

TODO

Handle updates

TODO

Handle demo servers and refresh

TODO

Containers docs

Here is a few information about the Dockerfile we wrote for each deployed repository.

  1. frontend (deployed on app.delibay.org)
  2. backend (deployed on several subdomains)
  3. website (deployed on delibay.org)