add dev container
Django CI/CD / test (push) Successful in 1m15s Details
Django CI/CD / build-and-push (push) Successful in 2m26s Details

This commit is contained in:
Lukáš Kucharczyk 2024-11-09 11:22:21 +01:00
parent d9290373b0
commit d81df6452a
2 changed files with 42 additions and 0 deletions

View File

@ -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"
}

21
devcontainer.Dockerfile Normal file
View File

@ -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