generated from erangel1/generic-template
added pre-development files
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
FROM python:3.14-slim
|
||||
|
||||
ARG USERNAME=vscode
|
||||
WORKDIR /workspace
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
postgresql-client \
|
||||
iputils-ping \
|
||||
nmap \
|
||||
build-essential \
|
||||
libpq-dev \
|
||||
git \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
||||
apt-get install -y nodejs
|
||||
|
||||
# Install Python dependencies
|
||||
COPY ../requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Default command (overridden by devcontainer.json)
|
||||
CMD ["sleep", "infinity"]
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "LabGraph-Dev-Env",
|
||||
"dockerComposeFile": "../docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspace",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"batisteo.vscode-django",
|
||||
"dsznajder.es7-react-js-snippets",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"tamasfe.even-better-toml",
|
||||
"mhutchie.git-graph"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
},
|
||||
"remoteUser": "vscode",
|
||||
"postCreateCommand": "pip install --upgrade pip && npm install -g npm@latest"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# Django Settings
|
||||
DEBUG=True
|
||||
SECRET_KEY=O+6Pr9xDz5/BxDMVxGtivAMkOHbRaAHLA5kc7P05a/4=
|
||||
ALLOWED_HOSTS=localhost,127.0.0.1
|
||||
|
||||
# Database
|
||||
DATABASE_URL=postgres://postgres:password@db:5432/labgraph
|
||||
|
||||
# Redis & Celery
|
||||
REDIS_URL=redis://redis:6379/0
|
||||
|
||||
# Discovery Credentials (Optional for Phase 1)
|
||||
PROXMOX_URL=
|
||||
PROXMOX_TOKEN_NAME=
|
||||
PROXMOX_TOKEN_VALUE=
|
||||
@@ -0,0 +1,54 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .devcontainer/Dockerfile.backend
|
||||
volumes:
|
||||
- .:/workspace:cached
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:password@db:5432/labgraph
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
networks:
|
||||
- labgraph-net
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
command: sleep infinity # Keeps the container alive for VS Code
|
||||
|
||||
db:
|
||||
image: postgres:18-alpine
|
||||
environment:
|
||||
- POSTGRES_DB=labgraph
|
||||
- POSTGRES_PASSWORD=password
|
||||
volumes:
|
||||
- labgraph_pg_data:/var/lib/postgresql
|
||||
networks:
|
||||
- labgraph-net
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
networks:
|
||||
- labgraph-net
|
||||
|
||||
worker:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .devcontainer/Dockerfile.backend
|
||||
volumes:
|
||||
- .:/workspace:cached
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:password@db:5432/labgraph
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
networks:
|
||||
- labgraph-net
|
||||
command: celery -A core worker --loglevel=info
|
||||
|
||||
networks:
|
||||
labgraph-net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
labgraph_pg_data:
|
||||
@@ -0,0 +1,21 @@
|
||||
# Web Framework & API
|
||||
django>=5.0,<5.1
|
||||
djangorestframework
|
||||
django-cors-headers
|
||||
django-environ
|
||||
|
||||
# Database & Task Queue
|
||||
psycopg[binary][cite: 1]
|
||||
celery[redis][cite: 1]
|
||||
django-celery-results[cite: 1]
|
||||
redis[cite: 1]
|
||||
|
||||
# Data Validation & Logic
|
||||
pydantic[cite: 1]
|
||||
requests[cite: 1]
|
||||
python-nmap
|
||||
|
||||
# Development & Security
|
||||
gunicorn
|
||||
whitenoise
|
||||
python-dotenv
|
||||
Reference in New Issue
Block a user