From 811d50f84b7cc90ee899e2171068727bf6619494 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 6 May 2023 18:15:03 +0200 Subject: [PATCH] make things work Signed-off-by: Jens Langhammer --- .devcontainer/Dockerfile | 4 +++- .devcontainer/devcontainer.json | 2 +- .devcontainer/docker-compose.yml | 9 +++++++-- .vscode/tasks.json | 18 +++++++++--------- Dockerfile | 4 ++-- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1e223d8ef..2e898deec 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,4 +2,6 @@ FROM ghcr.io/goauthentik/server:latest USER root -RUN pip install --no-cache-dir -r /requirements-dev.txt +HEALTHCHECK --interval=10s CMD exit 0 + +RUN pip install --no-cache-dir -r /app-root/requirements-dev.txt diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 44155bf85..edf5b5ace 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "authentik", "dockerComposeFile": "docker-compose.yml", "service": "app", - "workspaceFolder": "/authentik", + "workspaceFolder": "/app-root", "features": { "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, "ghcr.io/devcontainers/features/go:1": {}, diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 378cfb04c..d0c461ce1 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -6,8 +6,13 @@ services: context: .. dockerfile: .devcontainer/Dockerfile volumes: - - ../:/authentik:cached + - ../:/app-root:cached command: debug + environment: + AUTHENTIK_POSTGRESQL__USER: postgres + AUTHENTIK_POSTGRESQL__PASSWORD: postgres + AUTHENTIK_BOOTSTRAP_PASSWORD: akadmin + AUTHENTIK_BOOTSTRAP_TOKEN: akadmin db: image: docker.io/library/postgres:15 restart: unless-stopped @@ -16,7 +21,7 @@ services: network_mode: service:app environment: POSTGRES_USER: postgres - POSTGRES_DB: postgres + POSTGRES_DB: authentik POSTGRES_PASSWORD: postgres redis: image: docker.io/redis/redis-stack-server diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cd705afff..61762272e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,26 +3,23 @@ "tasks": [ { "label": "authentik[core]: format & test", - "command": "poetry", - "args": [ - "run", - "make" - ], + "command": "make", "group": "build", }, { "label": "authentik[core]: run", - "command": "poetry", + "command": "ak", "args": [ - "run", - "make", - "run", + "server", ], "group": "build", "presentation": { "panel": "dedicated", "group": "running" }, + "runOptions": { + "runOn": "folderOpen" + } }, { "label": "authentik[web]: format", @@ -39,6 +36,9 @@ "panel": "dedicated", "group": "running" }, + "runOptions": { + "runOn": "folderOpen" + } }, { "label": "authentik: install", diff --git a/Dockerfile b/Dockerfile index 7c9dab3e3..d899f21dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,7 +84,7 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends libxmlsec1-openssl libmaxminddb0 && \ # Required for bootstrap & healtcheck apt-get install -y --no-install-recommends runit && \ - pip install --no-cache-dir -r /requirements.txt && \ + pip install --no-cache-dir -r /app-root/requirements.txt && \ apt-get remove --purge -y build-essential pkg-config libxmlsec1-dev && \ apt-get autoremove --purge -y && \ apt-get clean && \ @@ -111,7 +111,7 @@ USER 1000 ENV TMPDIR /dev/shm/ ENV PYTHONUNBUFFERED 1 -ENV PATH "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/lifecycle" +ENV PATH "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app-root/lifecycle" HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 CMD [ "ak", "healthcheck" ]