From cf503a7b7d12e1639c448d696056f2f85da4ee9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sat, 9 Nov 2024 11:56:20 +0100 Subject: [PATCH] improve devcontainer --- .devcontainer/devcontainer.json | 44 ++++++++++++++++++--------------- devcontainer.Dockerfile | 5 +++- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fce9abb..3a16838 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,21 +1,25 @@ { - "name": "Django Time Tracker", - "dockerFile": "Dockerfile", - "customizations": { - "vscode": { - "settings": { - "python.pythonPath": "/usr/local/bin/python", - "python.defaultInterpreterPath": "/usr/local/bin/python", - "terminal.integrated.defaultProfile.linux": "bash" - }, - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "ms-azuretools.vscode-docker" - ] - } - }, - "forwardPorts": [8000], - "postCreateCommand": "poetry install && poetry run python manage.py migrate", - "remoteUser": "vscode" - } + "name": "Django Time Tracker", + "dockerFile": "../devcontainer.Dockerfile", + "customizations": { + "vscode": { + "settings": { + "python.pythonPath": "/usr/local/bin/python", + "python.defaultInterpreterPath": "/usr/local/bin/python", + "terminal.integrated.defaultProfile.linux": "bash" + }, + "extensions": [ + "ms-python.python", + "ms-python.debugpy", + "ms-python.vscode-pylance", + "ms-azuretools.vscode-docker", + "batisteo.vscode-django", + "charliermarsh.ruff", + "bradlc.vscode-tailwindcss", + "EditorConfig.EditorConfig" + ] + } + }, + "forwardPorts": [8000], + "postCreateCommand": "poetry install && poetry run python manage.py migrate && npm install && make dev", +} diff --git a/devcontainer.Dockerfile b/devcontainer.Dockerfile index 0215e3b..41467b8 100644 --- a/devcontainer.Dockerfile +++ b/devcontainer.Dockerfile @@ -5,7 +5,10 @@ ENV PYTHONUNBUFFERED=1 WORKDIR /workspace # Install Poetry -RUN apt-get update && apt-get install -y curl \ +RUN apt-get update && apt-get install -y \ + curl \ + make \ + npm \ && rm -rf /var/lib/apt/lists/* RUN curl -sSL https://install.python-poetry.org | python3 - ENV PATH="/root/.local/bin:$PATH"