some fixes?
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
# Django
|
||||||
|
DEBUG=1
|
||||||
|
SECRET_KEY=w(s0&(_eb058wvmg@44_repv8)r9@5p8fx*g_@c)1dm&d*ew^u
|
||||||
|
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
|
||||||
|
|
||||||
|
# External DB (you mentioned production uses an external DB)
|
||||||
|
DATABASE_HOST=db-postgresql-lon1-05515-jan-22-backup-do-user-8165014-0.c.db.ondigitalocean.com
|
||||||
|
DATABASE_PORT=25060
|
||||||
|
DATABASE_NAME=testing
|
||||||
|
DATABASE_USER=testing
|
||||||
|
DATABASE_PASSWORD=AVNS_ykXO4RxAq0zeJTI-1Nl
|
||||||
|
|
||||||
|
# Redis
|
||||||
|
REDIS_URL=redis://redis:6379/0
|
||||||
|
|
||||||
|
# Gunicorn tuning
|
||||||
|
GUNICORN_WORKERS=3
|
||||||
|
GUNICORN_LOGLEVEL=info
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
DEBUG=1
|
|
||||||
SECRET_KEY=w(s0&(_eb058wvmg@44_repv8)r9@5p8fx*g_@c)1dm&d*ew^u
|
|
||||||
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
|
|
||||||
|
|
||||||
DB_NAME=rad
|
|
||||||
DB_HOST=db
|
|
||||||
DB_USER=django
|
|
||||||
DB_PASSWORD=postgres
|
|
||||||
DB_PORT=5432
|
|
||||||
|
|
||||||
MEMCACHE_HOST=cache
|
|
||||||
|
|
||||||
# DEV-specific vars used by rad/settings_local.py
|
|
||||||
DEV_USE_POSTGRES=1
|
|
||||||
DEV_DB_NAME=${DB_NAME}
|
|
||||||
DEV_DB_USER=${DB_USER}
|
|
||||||
DEV_DB_PASSWORD=${DB_PASSWORD}
|
|
||||||
DEV_DB_HOST=${DB_HOST}
|
|
||||||
DEV_DB_PORT=${DB_PORT}
|
|
||||||
|
|
||||||
# pgAdmin creds
|
|
||||||
PGADMIN_DEFAULT_EMAIL=admin@example.com
|
|
||||||
PGADMIN_DEFAULT_PASSWORD=admin
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Development override: point the web service to rad/.env.dev and map nginx to
|
||||||
|
# non-privileged host ports so you can run without sudo.
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
env_file:
|
||||||
|
- ../.env.dev
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
- "8443:443"
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.4.2-alpine
|
image: redis:7.4.2-alpine
|
||||||
@@ -18,8 +16,10 @@ services:
|
|||||||
context: ..
|
context: ..
|
||||||
dockerfile: rad/Dockerfile.prod
|
dockerfile: rad/Dockerfile.prod
|
||||||
restart: always
|
restart: always
|
||||||
|
# Use COMPOSE_ENV to select which env file to load (defaults to 'prod').
|
||||||
|
# Example: COMPOSE_ENV=dev docker compose -f rad/docker/docker-compose.prod.yml -f rad/docker/docker-compose.dev.yml up -d
|
||||||
env_file:
|
env_file:
|
||||||
- ../.env.prod
|
- ../.env.${COMPOSE_ENV:-prod}
|
||||||
environment:
|
environment:
|
||||||
- DJANGO_SETTINGS_MODULE=rad.settings.production
|
- DJANGO_SETTINGS_MODULE=rad.settings.production
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"name": "rad",
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"python.testing.pytestArgs": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"python.testing.unittestEnabled": false,
|
||||||
|
"python.testing.pytestEnabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
-15
@@ -8,21 +8,22 @@ ENV PYTHONUNBUFFERED=1
|
|||||||
|
|
||||||
# Install build deps required for common Python packages and netcat for health wait
|
# Install build deps required for common Python packages and netcat for health wait
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
libcairo2-dev \
|
libcairo2-dev \
|
||||||
libgdk-pixbuf2.0-0 \
|
# some distributions provide libgdk-pixbuf under the xlib name
|
||||||
libgdk-pixbuf2.0-dev \
|
libgdk-pixbuf-xlib-2.0-0 \
|
||||||
libjpeg-dev \
|
libgdk-pixbuf-xlib-2.0-dev \
|
||||||
zlib1g-dev \
|
libjpeg-dev \
|
||||||
wget \
|
zlib1g-dev \
|
||||||
ca-certificates \
|
wget \
|
||||||
netcat \
|
ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
netcat-openbsd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
|||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
cd "$REPO_ROOT"
|
||||||
|
|
||||||
|
docker compose -f docker/docker-compose.prod.yml -f docker/docker-compose.test.yml -f docker/docker-compose.dev.yml down --volumes --remove-orphans
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Simple local bring-up helper. Usage:
|
||||||
|
# ./rad/scripts/local-up.sh
|
||||||
|
# It requires rad/.env.dev to exist (do NOT auto-create from examples) and then
|
||||||
|
# runs the prod+dev compose stack using COMPOSE_ENV to select the env file.
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
cd "$REPO_ROOT"
|
||||||
|
|
||||||
|
if [ ! -f .env.dev ]; then
|
||||||
|
echo ".env.dev not found. Create .env.dev with your development values (pointing to the external dev DB) and re-run."
|
||||||
|
echo "You can copy .env.prod.example to start from a template, but DO NOT commit secrets."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to 'dev' but allow overriding with COMPOSE_ENV environment variable
|
||||||
|
COMPOSE_ENV=${COMPOSE_ENV:-dev}
|
||||||
|
|
||||||
|
echo "Starting compose with COMPOSE_ENV=$COMPOSE_ENV (using .env.$COMPOSE_ENV)"
|
||||||
|
COMPOSE_ENV=$COMPOSE_ENV docker compose -f docker/docker-compose.prod.yml -f docker/docker-compose.dev.yml up -d --build
|
||||||
Reference in New Issue
Block a user