Use dind for maximum nonsense
This commit is contained in:
parent
bb0975a2d8
commit
5277cf0cc5
@ -4,8 +4,27 @@
|
||||
"dockerfile": "../dockerfiles/devcontainer.dockerfile",
|
||||
"context": ".."
|
||||
},
|
||||
"forwardPorts": [
|
||||
80, 443, 2019
|
||||
],
|
||||
"portsAttributes": {
|
||||
"80": {
|
||||
"label": "Plaintext",
|
||||
"protocol": "http",
|
||||
"elevateIfNeeded": true
|
||||
},
|
||||
"443": {
|
||||
"label": "Encrypted",
|
||||
"protocol": "https",
|
||||
"elevateIfNeeded": true
|
||||
},
|
||||
"2019": {
|
||||
"label": "Admin API",
|
||||
"protocol": "http",
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {
|
||||
"installDockerComposeSwitch": false
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
@ -23,9 +42,8 @@
|
||||
"onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/onCreate.sh",
|
||||
"postAttachCommand": "${containerWorkspaceFolder}/.devcontainer/postAttach.sh",
|
||||
"remoteEnv": {
|
||||
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
|
||||
"WORKSPACE_FOLDER": "${containerWorkspaceFolder}",
|
||||
"UV_LINK_MODE": "copy",
|
||||
"UV_LINK_MODE": "copy"
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
@ -37,7 +55,13 @@
|
||||
"type": "volume",
|
||||
"source": "${devcontainerId}-node-modules",
|
||||
"target": "${containerWorkspaceFolder}/node_modules"
|
||||
},
|
||||
{
|
||||
"type": "volume",
|
||||
"source": "${devcontainerId}-bashhistory",
|
||||
"target": "/commandhistory"
|
||||
}
|
||||
|
||||
],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
|
@ -13,7 +13,8 @@ git config --global --add safe.directory ${WORKSPACE_FOLDER}
|
||||
sudo chown $(id -u):$(id -g) -fR \
|
||||
${WORKSPACE_FOLDER} \
|
||||
${WORKSPACE_FOLDER}/.venv \
|
||||
${WORKSPACE_FOLDER}/node_modules
|
||||
${WORKSPACE_FOLDER}/node_modules \
|
||||
/commandhistory
|
||||
|
||||
cd ${WORKSPACE_FOLDER}
|
||||
|
||||
|
@ -7,14 +7,14 @@ services:
|
||||
pull_policy: build
|
||||
develop:
|
||||
watch:
|
||||
- path: ${LOCAL_WORKSPACE_FOLDER:-.}/kredens
|
||||
- path: ./kredens
|
||||
action: sync
|
||||
target: /app/kredens
|
||||
- path: ${LOCAL_WORKSPACE_FOLDER:-.}/pyproject.toml
|
||||
- path: ./pyproject.toml
|
||||
action: rebuild
|
||||
- path: ${LOCAL_WORKSPACE_FOLDER:-.}/manage.py
|
||||
- path: ./manage.py
|
||||
action: rebuild
|
||||
- path: ${LOCAL_WORKSPACE_FOLDER:-.}/uv.lock
|
||||
- path: ./uv.lock
|
||||
action: rebuild
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:${DATABASE_PASSWORD:?Database password required}@database/kredens
|
||||
@ -43,7 +43,7 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
volumes:
|
||||
- ${LOCAL_WORKSPACE_FOLDER:-.}/configs/caddy/:/etc/caddy/
|
||||
- ./configs/caddy/:/etc/caddy/
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
ports:
|
||||
|
@ -1,5 +1,7 @@
|
||||
FROM mcr.microsoft.com/devcontainers/base:bookworm
|
||||
|
||||
ARG USERNAME=vscode
|
||||
|
||||
# Install things I need for Caddy and such
|
||||
|
||||
RUN \
|
||||
@ -27,3 +29,11 @@ RUN \
|
||||
|
||||
RUN mkdir -p /workspaces/kredens && chown vscode:vscode /workspaces
|
||||
WORKDIR /workspaces/kredens
|
||||
|
||||
# Persist history
|
||||
|
||||
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
|
||||
&& mkdir /commandhistory \
|
||||
&& touch /commandhistory/.bash_history \
|
||||
&& chown -R $USERNAME /commandhistory \
|
||||
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"
|
6
justfile
6
justfile
@ -1,2 +1,8 @@
|
||||
watch:
|
||||
docker compose up --watch
|
||||
|
||||
migrate:
|
||||
uv run ./manage.py migrate
|
||||
|
||||
bootstrap:
|
||||
uv run ./manage.py bootstrap
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/5.1/ref/settings/
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
import dj_database_url
|
||||
|
||||
@ -82,6 +83,7 @@ WSGI_APPLICATION = "kredens.wsgi.application"
|
||||
|
||||
DATABASES = {
|
||||
"default": dj_database_url.config(
|
||||
default=f"postgres://postgres:{os.environ.get("DATABASE_PASSWORD")}@localhost/kredens",
|
||||
conn_max_age=600,
|
||||
conn_health_checks=True,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user