feat: initial project setup
- FastAPI backend (Python 3.12, uv) - React 19 + TypeScript + Vite frontend - Devcontainer with Node 22, Python 3.12, uv, opencode - Basic app structure and project docs
This commit is contained in:
commit
418318152a
20 changed files with 2324 additions and 0 deletions
43
.devcontainer/Dockerfile
Normal file
43
.devcontainer/Dockerfile
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
FROM mcr.microsoft.com/devcontainers/base:debian
|
||||
|
||||
ARG FORGEJO_USERNAME
|
||||
ENV FORGEJO_USERNAME=${FORGEJO_USERNAME}
|
||||
|
||||
# SSH (missing from base image)
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends openssh-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Node.js 22 + npm (npm tree copied; bin symlinks recreated - COPY dereferences them)
|
||||
COPY --from=node:22-slim /usr/local/bin/node /usr/local/bin/
|
||||
COPY --from=node:22-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
|
||||
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
|
||||
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
|
||||
|
||||
# uv (from distroless)
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
# Python 3.12 (system-shared location; default /root is unreadable for vscode)
|
||||
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
|
||||
RUN uv python install 3.12 \
|
||||
&& ln -s /opt/uv/python/cpython-3.12-linux-x86_64-gnu/bin/python3.12 /usr/local/bin/python3.12 \
|
||||
&& ln -s python3.12 /usr/local/bin/python3 \
|
||||
&& ln -s python3 /usr/local/bin/python
|
||||
|
||||
# Trust the workspace bind mount (source on Windows FS -> uid mismatch)
|
||||
RUN git config --system --add safe.directory /workspaces/kirche-einfach
|
||||
|
||||
# Pre-create named-volume targets (volumes inherit image content on first mount)
|
||||
RUN mkdir -p /workspaces/kirche-einfach/backend/.venv \
|
||||
/workspaces/kirche-einfach/frontend/node_modules
|
||||
|
||||
# opencode (as non-root user)
|
||||
USER vscode
|
||||
RUN curl -fsSL https://opencode.ai/install | bash
|
||||
USER root
|
||||
RUN ln -s /home/vscode/.opencode/bin/opencode /usr/local/bin/opencode
|
||||
|
||||
# Fix ownership (home + volume targets so vscode user can write)
|
||||
RUN chown -R vscode:vscode /home/vscode /workspaces
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
36
.devcontainer/devcontainer.json
Normal file
36
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "kirche-einfach",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"FORGEJO_USERNAME": "jonas"
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"source=${localEnv:USERPROFILE}/.ssh,target=/mnt/host-ssh,type=bind,readonly",
|
||||
"source=kirche-einfach-venv,target=/workspaces/kirche-einfach/backend/.venv,type=volume",
|
||||
"source=kirche-einfach-node-modules,target=/workspaces/kirche-einfach/frontend/node_modules,type=volume"
|
||||
],
|
||||
"remoteUser": "vscode",
|
||||
"containerEnv": {
|
||||
"FORGEJO_USERNAME": "jonas"
|
||||
},
|
||||
"overrideCommand": false,
|
||||
"workspaceFolder": "/workspaces/kirche-einfach",
|
||||
"postCreateCommand": "sudo -E bash .devcontainer/setup.sh",
|
||||
"postStartCommand": "mkdir -p ~/.ssh && cp /mnt/host-ssh/id_rsa /mnt/host-ssh/id_rsa.pub ~/.ssh/ && cp /mnt/host-ssh/known_hosts ~/.ssh/ 2>/dev/null; ssh-keyscan -t ed25519,rsa gitlab.jonas-miederer.com >> ~/.ssh/known_hosts 2>/dev/null; chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa && chmod 644 ~/.ssh/id_rsa.pub ~/.ssh/known_hosts",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"charliermarsh.ruff",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/workspaces/kirche-einfach/backend/.venv/bin/python"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
.devcontainer/setup.sh
Normal file
23
.devcontainer/setup.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "=== Setting up kirche-einfach ==="
|
||||
|
||||
# Backend
|
||||
echo "--- Installing Python dependencies ---"
|
||||
cd /workspaces/kirche-einfach/backend
|
||||
uv sync
|
||||
|
||||
# Frontend
|
||||
echo "--- Installing Node dependencies ---"
|
||||
cd /workspaces/kirche-einfach/frontend
|
||||
npm install
|
||||
|
||||
echo ""
|
||||
echo "=== Setup complete ==="
|
||||
echo "Forgejo username: $FORGEJO_USERNAME"
|
||||
|
||||
# Hand dirs back to vscode (this script runs via sudo; uv/npm create caches as root)
|
||||
chown -R vscode:vscode /workspaces/kirche-einfach/backend/.venv \
|
||||
/workspaces/kirche-einfach/frontend/node_modules \
|
||||
/home/vscode/.cache 2>/dev/null || true
|
||||
Loading…
Add table
Add a link
Reference in a new issue