diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fce9abb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "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" + } diff --git a/devcontainer.Dockerfile b/devcontainer.Dockerfile new file mode 100644 index 0000000..0215e3b --- /dev/null +++ b/devcontainer.Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.13-slim + +# Set up environment +ENV PYTHONUNBUFFERED=1 +WORKDIR /workspace + +# Install Poetry +RUN apt-get update && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* +RUN curl -sSL https://install.python-poetry.org | python3 - +ENV PATH="/root/.local/bin:$PATH" + +# Copy pyproject.toml and poetry.lock for dependency installation +COPY pyproject.toml poetry.lock* ./ +RUN poetry install --no-root + +# Copy the rest of the application code +COPY . . + +# Set up Django development server +EXPOSE 8000