diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2c5e820..0a93e44 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1 @@ FROM python:3.12 - -# Install python requirements -COPY backend/requirements-combined.txt requirements-combined.txt -RUN pip install -r requirements-combined.txt \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e7978a8..4dc5636 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,21 +1,17 @@ { - "name": "retro_olympics_webapp", + "name": "retro_olympics", "dockerComposeFile": "docker-compose.yml", - "workspaceFolder": "/workspace", "service": "webapp", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "20.15.0", + "nvmVersion": "latest" + } + }, "customizations": { "vscode": { - "settings": { - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - } - }, - "isort.args": ["--profile", "black"], - "ruff.nativeServer": true - }, "extensions": [ "ms-python.python", "ms-python.vscode-pylance", @@ -27,6 +23,7 @@ }, "remoteUser": "root", "remoteEnv": { - "PYTHONPATH": "/workspace/backend/src" - } + "PYTHONPATH": "/workspaces/${localWorkspaceFolderBasename}/backend/src" + }, + "postCreateCommand": "cd backend/ && pip install -r requirements-combined.txt" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c4e1ce5..3e6c7ae 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,13 +1,22 @@ version: "3.8" + services: webapp: build: - context: .. - dockerfile: .devcontainer/Dockerfile + context: . + dockerfile: Dockerfile entrypoint: ["tail", "-f", "/dev/null"] volumes: - - ..:/workspace - postgres: - image: "postgres:16" + - ../..:/workspaces:cached + command: sleep infinity + network_mode: service:db + db: + image: postgres:16-alpine + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data environment: - POSTGRES_HOST_AUTH_METHOD: trust \ No newline at end of file + POSTGRES_HOST_AUTH_METHOD: trust + +volumes: + postgres-data: \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ef4007b..d88b552 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,14 @@ "eslint.workingDirectories": ["frontend"], "eslint.validate": ["typescript", "typescriptreact"], "typescript.tsdk": "./frontend/node_modules/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true + "typescript.enablePromptUseWorkspaceTsdk": true, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + } + }, + "isort.args": ["--profile", "black"], + "ruff.nativeServer": true } \ No newline at end of file diff --git a/frontend/.nvmrc b/frontend/.nvmrc index 93a75dd..4746584 100644 --- a/frontend/.nvmrc +++ b/frontend/.nvmrc @@ -1 +1 @@ -v20.14.0 \ No newline at end of file +v20.15.0 \ No newline at end of file