Skip to content

Commit 257ff50

Browse files
committed
refine the whole prod setup
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 273c52e commit 257ff50

5 files changed

Lines changed: 25 additions & 67 deletions

File tree

compose.build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: dejacode
2+
3+
x-description: "Build override — builds the app image from source instead of using the pre-built image"
4+
5+
services:
6+
web:
7+
build: .
8+
9+
worker:
10+
build: .
11+
12+
scheduler:
13+
build: .

compose.prod.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

compose.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ services:
8484
- "${NGINX_PUBLISHED_HTTP_PORT:-80}:80"
8585
- "${NGINX_PUBLISHED_HTTPS_PORT:-443}:443"
8686
volumes:
87+
- ./etc/nginx/conf.d/:/etc/nginx/conf.d/
8788
- static:/var/dejacode/static/
8889
- webroot:/var/www/html/
89-
configs:
90-
- source: nginx_conf
91-
target: /etc/nginx/conf.d/default.conf
9290
depends_on:
9391
- web
9492
restart: always
@@ -107,29 +105,3 @@ volumes:
107105
static:
108106
media:
109107
webroot:
110-
111-
configs:
112-
nginx_conf:
113-
content: |
114-
upstream gunicorn_app {
115-
server web:8000;
116-
}
117-
server {
118-
listen 80;
119-
http2 on;
120-
server_tokens off;
121-
gzip on;
122-
gzip_comp_level 6;
123-
gzip_types text/css text/javascript application/javascript image/svg+xml;
124-
location / {
125-
proxy_pass http://gunicorn_app;
126-
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
127-
proxy_set_header Host $$http_host;
128-
proxy_redirect off;
129-
client_max_body_size 1G;
130-
proxy_read_timeout 600s;
131-
}
132-
location /static/ {
133-
alias /var/dejacode/static/;
134-
}
135-
}

docs/installation.rst

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ There are three ways to run DejaCode:
1212

1313
- :ref:`run_with_docker` — **simplest option**, no repository checkout or build step
1414
required. Uses the pre-built Docker image published on GitHub.
15-
- :ref:`enterprise_deployment` — same pre-built image with custom nginx, domain
16-
configuration, and hardware recommendations for production servers.
15+
- :ref:`enterprise_deployment` — same pre-built image with custom nginx configuration,
16+
domain settings, and hardware recommendations for production servers.
1717
- :ref:`local_development_installation` — Docker-based setup for contributors.
1818

1919
.. _run_with_docker:
@@ -44,7 +44,7 @@ Run the one-liner installer::
4444
This script will:
4545

4646
- Create ``~/.dejacode/`` as the installation directory
47-
- Download ``compose.yml``, ``docker.env``, and the database seed data
47+
- Download ``compose.yml``, ``docker.env``, the nginx configuration, and the database seed data
4848
- Generate ``.env`` with a secure secret key
4949
- Install the ``dejacode`` command in ``~/.local/bin/``
5050
- Start all services and wait until the application is ready
@@ -145,26 +145,13 @@ Restart the stack to apply::
145145
The default nginx configuration embedded in ``compose.yml`` is suitable for
146146
local use. For production, replace it with your own configuration file.
147147

148-
Create a ``compose.override.yml`` in your installation directory
149-
(``~/.dejacode/``) with the following content:
150-
151-
.. code-block:: yaml
152-
153-
services:
154-
nginx:
155-
configs: []
156-
volumes:
157-
- ./nginx.conf:/etc/nginx/conf.d/default.conf
158-
159-
Then create ``~/.dejacode/nginx.conf`` with your production nginx configuration
160-
(TLS termination, custom headers, upstream settings, etc.) and restart::
148+
The installer downloads a default nginx configuration to
149+
``~/.dejacode/etc/nginx/conf.d/default.conf``. Replace it with your own
150+
configuration (TLS termination, custom headers, upstream settings, etc.)
151+
and restart::
161152

162153
dejacode down && dejacode up -d
163154

164-
.. note::
165-
Docker Compose automatically picks up ``compose.override.yml`` when present
166-
in the same directory as ``compose.yml``.
167-
168155
4. AboutCode integrations
169156
--------------------------
170157

install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ curl -sSL "$REPO/data/postgresql/initdb.sql.gz" -o data/postgresql/initdb.sql.gz
3434
info "Downloading docker.env"
3535
curl -sSL "$REPO/docker.env" -o docker.env
3636

37+
info "Downloading nginx configuration"
38+
mkdir -p etc/nginx/conf.d
39+
curl -sSL "$REPO/etc/nginx/conf.d/default.conf" -o etc/nginx/conf.d/default.conf
40+
3741
# ── Generate .env with a secure secret key ────────────────────────────────────
3842
info "Generating .env"
3943
# Read enough bytes from urandom so tr has enough after filtering, then cut to 50 chars.

0 commit comments

Comments
 (0)