generated from bisco/codex-bootstrap
feat: add Django backend skeleton
This commit is contained in:
@@ -5,18 +5,17 @@ ENV PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install --no-cache-dir \
|
||||
"Django==5.2.3" \
|
||||
"djangorestframework==3.16.0" \
|
||||
"gunicorn==23.0.0" \
|
||||
"psycopg[binary]==3.2.9"
|
||||
|
||||
RUN useradd --create-home --shell /usr/sbin/nologin appuser
|
||||
|
||||
COPY placeholder_wsgi.py /app/placeholder_wsgi.py
|
||||
COPY requirements/backend.txt /app/requirements/backend.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements/backend.txt
|
||||
|
||||
COPY backend/ /app/backend/
|
||||
|
||||
WORKDIR /app/backend
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "placeholder_wsgi:application"]
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "azionelab.wsgi:application"]
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
def application(environ, start_response):
|
||||
body = b"AzioneLab backend placeholder\n"
|
||||
start_response(
|
||||
"503 Service Unavailable",
|
||||
[
|
||||
("Content-Type", "text/plain; charset=utf-8"),
|
||||
("Content-Length", str(len(body))),
|
||||
],
|
||||
)
|
||||
return [body]
|
||||
@@ -1,13 +1,16 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
context: ../..
|
||||
dockerfile: infra/docker/backend/Dockerfile
|
||||
image: azionelab-backend:local
|
||||
environment:
|
||||
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
|
||||
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS}
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: ${DJANGO_CSRF_TRUSTED_ORIGINS}
|
||||
DJANGO_DEBUG: ${DJANGO_DEBUG:-false}
|
||||
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
|
||||
TIME_ZONE: ${TIME_ZONE:-Europe/Rome}
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
|
||||
Reference in New Issue
Block a user