39 lines
1.7 KiB
YAML
39 lines
1.7 KiB
YAML
# Local override (T13.8). Use it only on your own PC, never on the host.
|
|
#
|
|
# docker compose -f docker-compose.yml -f docker-compose.local.yml up -d --build
|
|
#
|
|
# What it changes, and why:
|
|
# 1. It publishes the web server on http://localhost:8080 (loopback only). On the
|
|
# host a reverse proxy reaches the web server over the `proxy` network and no
|
|
# port is published.
|
|
# 2. It replaces the external `proxy` network with an ordinary bridge that this
|
|
# stack owns. A `proxy` network that already exists on a PC may have no gateway
|
|
# (internal), and Docker does not publish ports through such a network.
|
|
# 3. It makes the web server answer for any host name, so http://localhost:8080
|
|
# works. The shipped nginx config answers only for wp.controls.dev, and
|
|
# without this every /api request from localhost gets a 404. The change is
|
|
# made when the container starts: it removes the stock default.conf, which
|
|
# answers to "localhost" first, and marks the app server as the default. The
|
|
# shipped config file is not edited.
|
|
# 4. It turns the backup service off. Its scripts are checked out with CRLF line
|
|
# endings on Windows and cannot start (BL-070). To start it anyway, add
|
|
# --profile backup.
|
|
#
|
|
# Sign-in needs a real Okta redirect URI, so this stack proves the build, the
|
|
# database migrations on Postgres, and the Okta sync. It does not prove sign-in.
|
|
services:
|
|
webserver:
|
|
ports:
|
|
- "127.0.0.1:8080:80"
|
|
command:
|
|
- sh
|
|
- -c
|
|
- rm -f /etc/nginx/conf.d/default.conf && sed -i 's/listen 80;/listen 80 default_server;/' /etc/nginx/conf.d/wp-suite.conf && exec nginx -g 'daemon off;'
|
|
backup:
|
|
profiles: ["backup"]
|
|
|
|
networks:
|
|
proxy: !override
|
|
name: wp_local_proxy
|
|
driver: bridge
|