From 2909ff1ff56b530c2cca1acebc052820ef563ff3 Mon Sep 17 00:00:00 2001 From: cswimr Date: Wed, 29 Jan 2025 04:22:28 -0600 Subject: [PATCH] add devcontainer --- .devcontainer/Dockerfile | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 0 .devcontainer/home/.bash_aliases | 3 +++ 4 files changed, 50 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .devcontainer/home/.bash_aliases diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..a6c0ec7 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +FROM ghcr.io/astral-sh/uv:0.5.25 AS uv +FROM python:3.13-slim AS python +FROM code.forgejo.org/forgejo/runner:6.2.0@sha256:936c4fef04f0e2bda86c325b8ef40359aeead4740a48b1d5a0c9a112f1185e45 AS forgejo-runner + +FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm@sha256:6155a486f236fd5127b76af33086029d64f64cf49dd504accb6e5f949098eb7e +LABEL repository="www.coastalcommits.com/cswimr/PyZipline" +LABEL maintainer="cswimr " + +COPY --from=uv --chown=vscode: /uv /uvx /bin/ +COPY --from=python --chown=vscode: /usr/local /usr/local +COPY --from=forgejo-runner --chown=vscode: /bin/forgejo-runner /bin/forgejo-runner +COPY --chown=vscode: .devcontainer/home/* /home/vscode/ + +RUN ln -s /usr/local/bin/python3.13 /usr/local/bin/python; \ + python --version; \ + python -m ensurepip diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0a92ce0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "PyZipline", + "dockerComposeFile": "docker-compose.yml", + "service": "devcontainer", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "customizations": { + "vscode": { + "extensions": [ + "charliermarsh.ruff", + "ms-python.python", + "tekumara.typos-vscode", + "tamasfe.even-better-toml", + "redhat.vscode-yaml", + "DavidAnson.vscode-markdownlint", + "aaron-bond.better-comments", + "donjayamanne.githistory", + "eamodio.gitlens" + ] + } + }, + "containerEnv": { + "DISPLAY": "dummy", + "PYTHONUNBUFFERED": "True", + "UV_LINK_MODE": "copy", + "UV_PYTHON_PREFERENCE": "only-system", + "UV_PYTHON_DOWNLOADS": "never", + "PROJECT_DIR": "/workspaces/${localWorkspaceFolderBasename}" + }, + "postCreateCommand": "uv sync --frozen", + "remoteUser": "vscode" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/.devcontainer/home/.bash_aliases b/.devcontainer/home/.bash_aliases new file mode 100644 index 0000000..277fc5f --- /dev/null +++ b/.devcontainer/home/.bash_aliases @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +alias runactions="forgejo-runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com"