add dev container
This commit is contained in:
parent
d9290373b0
commit
d81df6452a
|
@ -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"
|
||||||
|
}
|
|
@ -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
|
Loading…
Reference in New Issue