feat: Docker Compose deployment configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
12
.dockerignore
Normal file
12
.dockerignore
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
.venv
|
||||||
|
.env
|
||||||
|
*.egg-info
|
||||||
|
.git
|
||||||
|
.pytest_cache
|
||||||
|
.mypy_cache
|
||||||
|
tests/
|
||||||
|
scripts/
|
||||||
|
docs/
|
||||||
|
db.sqlite3
|
||||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential libpq-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE ${DJANGO_PORT:-8000}
|
||||||
|
|
||||||
|
CMD ["gunicorn", "--bind", "0.0.0.0:${DJANGO_PORT:-8000}", \
|
||||||
|
"--workers", "4", "--timeout", "120", \
|
||||||
|
"config.wsgi:application"]
|
||||||
30
docker-compose.yml
Normal file
30
docker-compose.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: openclaw-archive
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
ports:
|
||||||
|
- "${DJANGO_PORT:-8000}:${DJANGO_PORT:-8000}"
|
||||||
|
volumes:
|
||||||
|
- static_volume:/app/staticfiles
|
||||||
|
- jsonl_archive:/app/archive
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# nginx placeholder (uncomment for production)
|
||||||
|
# nginx:
|
||||||
|
# image: nginx:alpine
|
||||||
|
# container_name: openclaw-nginx
|
||||||
|
# ports:
|
||||||
|
# - "80:80"
|
||||||
|
# volumes:
|
||||||
|
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
# - static_volume:/app/staticfiles:ro
|
||||||
|
# depends_on:
|
||||||
|
# - web
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
static_volume:
|
||||||
|
jsonl_archive:
|
||||||
27
nginx/nginx.conf.placeholder
Normal file
27
nginx/nginx.conf.placeholder
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Nginx reverse proxy placeholder for OpenClaw Archive
|
||||||
|
#
|
||||||
|
# To enable:
|
||||||
|
# 1. Rename this file to nginx.conf
|
||||||
|
# 2. Update server_name and SSL certificate paths
|
||||||
|
# 3. Uncomment the nginx service in docker-compose.yml
|
||||||
|
|
||||||
|
upstream django {
|
||||||
|
server web:8000;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _; # Update for production
|
||||||
|
|
||||||
|
location /static/ {
|
||||||
|
alias /app/staticfiles/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://django;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user