···11-FROM registry.fedoraproject.org/fedora-minimal:latest
22-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
33-44-# Control these if you need to change the values in the 'devcontainer.json'
55-# file in the directory. They have matching values.
66-ARG USERNAME=vscode
77-ARG USERID=1000
88-ARG GROUPID=1000
99-1010-# Setup the user, basic packages, and python environment.
1111-# Try to keep everything system setup here.
1212-RUN set -ex; \
1313- dnf5 update -y; \
1414- dnf5 install --setopt=install_weak_deps=False -y \
1515- python3-devel python3-wheel tar gcc make git wget which \
1616- cmake clang++ lldb curl vim procps-ng openssh-clients; \
1717- \
1818- python3 -m ensurepip --upgrade; \
1919- python3 -m pip install --no-cache-dir --upgrade pip; \
2020- \
2121- groupadd --gid ${GROUPID} ${USERNAME}; \
2222- useradd --gid ${GROUPID} --uid ${USERID} -p ${USERNAME} \
2323- -s /bin/bash -m ${USERNAME}; \
2424-2525-ENV MISE_DATA_DIR="/mise"
2626-ENV MISE_CONFIG_DIR="/mise"
2727-ENV MISE_CACHE_DIR="/mise/cache"
2828-ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
2929-ENV PATH="/mise/shims:$PATH"
3030-RUN curl https://mise.run | sh
3131-3232-# Cleanup the installation and other packages here.
3333-# No more package installation from DNF should happen after this point.
3434-RUN set -ex; \
3535- dnf5 clean all -y; \
3636- rm -rf /var/cache/yum/* /var/cache/dnf/* /usr/share/doc/*;
3737-3838-# Ensure that the container is running the user that was created and the
3939-# workspace matyches what we expect by default.
4040-ENV PYTHONDONTWRITEBYTECODE=1
4141-WORKDIR /home/${USERNAME}
4242-USER ${USERNAME}
-57
.devcontainer/fedora_devenv/devcontainer.json
···11-// Based on https://github.com/danweinerdev/fedora-devcontainer-template/
22-{
33- "containerUser": "vscode",
44- "remoteUser": "vscode",
55- "mounts": [],
66- "customizations": {
77- "vscode": {
88- "extensions": [
99- "EditorConfig.EditorConfig",
1010- "ms-vscode.cpptools-themes",
1111- "twxs.cmake",
1212- "ms-vscode.cmake-tools"
1313- ],
1414- "settings": {
1515- "files.exclude": {
1616- "**/.classpath": true,
1717- "**/.DS_Store": true,
1818- "**/.factorypath": true,
1919- "**/.git": true,
2020- "**/.project": true,
2121- "**/.settings": true,
2222- "**/*.js": {
2323- "when": "$(basename).ts"
2424- },
2525- "**/*.js.map": true
2626- },
2727- "telemetry.telemetryLevel": "off"
2828- }
2929- }
3030- },
3131- "features": {},
3232- "name": "Lumina Fedora-based devenv",
3333- "build": {
3434- "dockerfile": "./devcontainer.Dockerfile"
3535- },
3636- // "features": {
3737- // ghcr.io/devcontainers/features/docker-in-docker:2": {},
3838- // "ghcr.io/devcontainers-extra/features/mise:1": {}
3939- // },
4040- // Features to add to the dev container. More info: https://containers.dev/features.
4141- // "features": {},
4242- // Use 'forwardPorts' to make a list of ports inside the container available locally.
4343- "forwardPorts": [8085],
4444- // Use 'postCreateCommand' to run commands after the container is created.
4545- "postCreateCommand": [
4646- "mise trust",
4747- "mise use -g usage",
4848- "mise install",
4949- "mkdir -p ~/.local/share/bash-completion/completions",
5050- "mise completion bash --include-bash-completion-lib > ~/.local/share/bash-completion/completions/mise"
5151- ],
5252- "postStartCommand": ["git remote set-url origin ssh://git@codeberg.org/strawmelonjuice/Lumina.git"]
5353- // Configure tool-specific properties.
5454- // "customizations": {},
5555- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
5656- // "remoteUser": "root"
5757-}
-27
.devcontainer/ghcodespaces/devcontainer.json
···11-// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22-// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33-{
44- "name": "Lumina devcontainer for GH codespaces",
55- // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
66- "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
77- "features": {
88- "ghcr.io/devcontainers-extra/features/mise": {
99- "version": "latest"
1010- },
1111- "ghcr.io/devcontainers/features/docker-in-docker:2.12.4": {
1212- "version": "latest"
1313- }
1414- },
1515-1616- "postCreateCommand": "bash .devcontainer/ghcodespaces/scripts/postCreate.sh",
1717- "postAttachCommand": "bash .devcontainer/ghcodespaces/scripts/postAttach.sh"
1818-1919- // Use 'forwardPorts' to make a list of ports inside the container available locally.
2020- // "forwardPorts": [],
2121-2222- // Configure tool-specific properties.
2323- // "customizations": {},
2424-2525- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
2626- // "remoteUser": "root"
2727-}
-32
.devcontainer/ghcodespaces/scripts/podman
···11-#!/usr/bin/env bash
22-# This script sets up Docker as if it were Podman for compatibility in the devcontainer.
33-set -euo pipefail
44-55-# Parse arguments to find --name and handle --replace
66-args=()
77-container_name=""
88-has_replace=false
99-next_is_name=false
1010-1111-for arg in "$@"; do
1212- if [ "$arg" = "--replace" ]; then
1313- has_replace=true
1414- # Don't add --replace to args (not supported in docker)
1515- elif [ "$arg" = "--name" ]; then
1616- next_is_name=true
1717- args+=("$arg")
1818- elif [ "$next_is_name" = true ]; then
1919- container_name="$arg"
2020- next_is_name=false
2121- args+=("$arg")
2222- else
2323- args+=("$arg")
2424- fi
2525-done
2626-2727-# If --replace flag was present and we have a container name, remove existing container
2828-if [ "$has_replace" = true ] && [ -n "$container_name" ]; then
2929- docker rm -f "$container_name" >/dev/null 2>&1 || true
3030-fi
3131-3232-docker "${args[@]}"
-11
.devcontainer/ghcodespaces/scripts/postAttach.sh
···11-#!/usr/bin/env bash
22-set -euo pipefail
33-44-echo "Running devcontainer post-attach script"
55-66-if command -v mise >/dev/null 2>&1; then
77- echo "Found mise — running local-devel-prep"
88- mise run local-devel-prep || true
99-else
1010- echo "mise not found; skipping local-devel-prep"
1111-fi
-31
.devcontainer/ghcodespaces/scripts/postCreate.sh
···11-#!/usr/bin/env bash
22-set -euo pipefail
33-44-log() { printf '%s\n' "$1"; }
55-66-log "Running devcontainer post-create script"
77-88-# Set up Podman compatibility script
99-log "Setting up Podman compatibility script"
1010-sudo cp .devcontainer/ghcodespaces/scripts/podman /usr/local/bin/podman
1111-sudo chmod +x /usr/local/bin/podman
1212-1313-1414-# Configure mise if available
1515-if command -v mise >/dev/null 2>&1; then
1616- log "Configuring mise"
1717- mise trust || true
1818- mise use -g usage || true
1919- mise install || true
2020- mkdir -p ~/.local/share/bash-completion/completions
2121- mise completion bash --include-bash-completion-lib > ~/.local/share/bash-completion/completions/mise || true
2222- echo 'eval "$(mise activate bash)"' >> ~/.bashrc
2323-fi
2424-2525-# Configure git remotes (best-effort, won't fail the script)
2626-log "Configuring git remotes (best-effort)"
2727-git remote set-url origin ssh://git@codeberg.org/strawmelonjuice/Lumina.git || true
2828-git remote add github-remote ssh://git@github.com/strawmelonjuice/lumina.git || true
2929-git remote add strawmeloncode ssh://git@git.strawmelonjuice.com/strawmelonjuice/Lumina.git || true
3030-3131-log "Post-create script finished"
-33
.devcontainer/ubuntu devenv/devcontainer.json
···11-// The Ubuntu-based devenv is lighter tested than the Fedora based one.
22-// But in combination with microsoft's stuff, including GitHub codespaces, it's the best performant option. Probably.
33-//
44-// That said, you'll have the problem with docker vs. podman. That's yours to deal with. :P (just replace podman in the local devel prep task and most cases should be fine)
55-66-{
77- "name": "Lumina Ubuntu-based devenv",
88- "image": "ghcr.io/prulloac/base:ubuntu-24.04",
99-1010- // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
1111- "features": {
1212- "ghcr.io/devcontainers/features/docker-in-docker:2": {},
1313- "ghcr.io/devcontainers-extra/features/mise:1": {},
1414- "ghcr.io/devcontainers/features/rust": {
1515- "version": "latest",
1616- "profile": "default"
1717- }
1818- },
1919-2020- // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
2121- // "forwardPorts": [],
2222-2323- "postCreateCommand": [
2424- "mise trust",
2525- "mise use -g usage",
2626- "mise install",
2727- "mkdir -p ~/.local/share/bash-completion/completions",
2828- "mise completion bash --include-bash-completion-lib > ~/.local/share/bash-completion/completions/mise"
2929- ],
3030- "postStartCommand": ["git remote set-url origin ssh://git@codeberg.org/strawmelonjuice/Lumina.git"]
3131- // 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
3232- // "remoteUser": "root"
3333-}
+52
Justfile
···11+default:
22+ @just --list
33+44+[doc("Build the styles for Lumina client")]
55+[group('building')]
66+build-styles:
77+ cd ./client/ && bun x @tailwindcss/cli -i ./app.css -o ./priv/static/lumina_client.css
88+99+[doc("Build the server-side of Lumina")]
1010+[group('building')]
1111+build-server: build-client
1212+ cargo build
1313+1414+[doc("Build the server-side of Lumina optimised for release")]
1515+[group('building')]
1616+build-server-release: build-client
1717+ cargo build --release
1818+1919+[doc("Build the client-side of Lumina and it's styles")]
2020+[group('building')]
2121+build-client: build-styles
2222+ cd ./client/ &&\
2323+ gleam build --target javascript &&\
2424+ echo 'import { main } from "./lumina_client.mjs";document.addEventListener("DOMContentLoaded", main())' > "./build/dev/javascript/lumina_client/lumina_client.ts" &&\
2525+ bun build ./build/dev/javascript/lumina_client/lumina_client.ts --minify --outfile ./priv/static/lumina_client.min.mjs --target=browser &&\
2626+ bun build ./build/dev/javascript/lumina_client/lumina_client.ts --outfile ./priv/static/lumina_client.mjs --target=browser
2727+2828+[doc("Prefetch Gleam dependencies to speed up future builds")]
2929+[group('prepare')]
3030+prefetch-gleam-deps:
3131+ cd ./client && gleam deps download
3232+3333+[doc("Install Bun dependencies")]
3434+[group('prepare')]
3535+bun-install:
3636+ cd ./client && bun i
3737+3838+[group('prepare')]
3939+create-data-dirs:
4040+ mkdir -p ./data
4141+ mkdir -p ./data/postgres
4242+ mkdir -p ./data/redis
4343+4444+[doc("Clean all build artifacts")]
4545+clean-all:
4646+ cargo clean
4747+ rm -rf ./client/node_modules
4848+ rm -rf ./client/build
4949+ rm -rf ./client/build/dev/javascript/lumina_client/lumina_client.mjs
5050+ rm -rf ./client/build/dev/javascript/lumina_client/lumina_client.ts
5151+ rm -rf ./client/priv/static/lumina_client.min.mjs
5252+ rm -rf ./client/priv/static/lumina_client.css