Skip to content

Commit

Permalink
Add an nginx server to compose, to replace the one removed in v2023-1…
Browse files Browse the repository at this point in the history
…. References pretalx#62
  • Loading branch information
robe2 committed Apr 14, 2024
1 parent ed9908a commit 1648e2c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ This repository contains a docker-compose setup as well as an [ansible](https://
* Edit ``conf/pretalx.cfg`` and fill in your own values (→ [configuration
documentation](https://docs.pretalx.org/en/latest/administrator/configure.html))
* Edit ``docker-compose.yml``
* If you plan to run a nginx within docker-compose remove the complete section with ``ports: - "80:80"`` and unremark out the ``web`` container section.
Make sure to edit the deployment\docker\nginx.conf to suit your needs
* If you plan to run a nginx within docker-compose remove the complete section with ``ports: - "80:80"`` in the pretalx container definition
and unremark out the ``web`` container section.
Make sure to edit the deployment\docker\nginx.conf to suit your needs.
* **Change the database password.**
* If you don't want to use docker volumes, create directories for the persistent data and make them read-writeable for
the userid 999 and the groupid 999. Change ``pretalx-redis``, ``pretalx-db``, ``pretalx-data`` and ``pretalx-public`` to the corresponding
Expand All @@ -27,7 +28,7 @@ This repository contains a docker-compose setup as well as an [ansible](https://
network. I recommend to go with traefik for its ease of setup, docker integration and [LetsEncrypt
support](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/). An example to copy into the normal compose file
is located at ``reverse-proxy-examples/docker-compose``. You can also find a few words on an nginx configuration at
``reverse-proxy-examples/nginx``
``reverse-proxy-examples/nginx``.
* Make sure you serve all requests for the `/static/` and `/media/` paths (when `debug=false`). See [installation](https://docs.pretalx.org/administrator/installation/#step-7-ssl) for more information
* Optional: Some of the Gunicorn parameters can be adjusted via environment variables:
* To adjust the number of [Gunicorn workers](https://docs.gunicorn.org/en/stable/settings.html#workers), provide
Expand Down
4 changes: 1 addition & 3 deletions conf/pretalx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# use PRETALX_FILESYSTEM_* env vars

[site]
; never run debug in production. Make sure you serve all requests for the
; `/static/` and `/media/` paths when debug is False.
; See [installation](https://docs.pretalx.org/administrator/installation/#step-7-ssl) for more information
; never run debug in production.
debug = True
url = http://localhost

Expand Down
44 changes: 21 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ services:
- redis
- db
environment:
# Hint: Make sure you serve all requests for the `/static/` and `/media/` paths when debug is False. See [installation](https://docs.pretalx.org/administrator/installation/#step-7-ssl) for more information
PRETALX_FILESYSTEM_MEDIA: /public/media
PRETALX_FILESYSTEM_STATIC: /public/static
ports:
- "80:80"
## You can unremark out the ports section if you only need dev testing
## Make sure to remove the web section or change the port if you remark this out
#ports:
# - "80:80"
volumes:
- ./conf/pretalx.cfg:/etc/pretalx/pretalx.cfg:ro
- pretalx-data:/data
- pretalx-public:/public

# Hint: This container is for production use needed to serve static and media files
# See README.md and reverse-proxy-examples for proxying this for TLS/SSL
web:
image: nginx:latest
container_name: pretalx-web
restart: unless-stopped
# remove the ports section if you plan to use docker based traefik for tls/ssl endpoint
ports:
- "80:80"
depends_on:
- pretalx
# this section is needed if you plan to use traefik as your tls/ssl end point
labels:
traefik.docker.network: "pretalxdocker"
traefik.enable: "true"

# Hint: Unremark this section, if you want to run the webserver within docker network.
# Make sure to also remark out the "80:80" in the pretalx container section
# See README for more details

# web:
# image: nginx:latest
# container_name: pretalx-web
# restart: unless-stopped
# ports:
# - "80:80"
# - "443:443"
# depends_on:
# - pretalx
# volumes:
# - ./deployment/docker/nginx.conf:/etc/nginx/nginx.conf
# - pretalx-data:/data
# - pretalx-public:/public
volumes:
- ./deployment/docker/nginx.conf:/etc/nginx/nginx.conf
- pretalx-data:/data
- pretalx-public:/public

db:
image: mysql:latest
Expand All @@ -52,8 +52,6 @@ services:
MYSQL_RANDOM_ROOT_PASSWORD: "1"
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']



redis:
image: redis:latest
container_name: pretalx-redis
Expand Down
9 changes: 9 additions & 0 deletions reverse-proxy-examples/nginx/Readme.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# NGINX Config example

Change the port section of the web container to below, note the 8355 port
as that is the port that will be exposed for proxy.
You can use a different port other than 8355,
but make sure the proxy_pass line matches whatever port you choose.

```
ports:
- "8355:80"
```
Your config could look like this:

```
Expand Down

0 comments on commit 1648e2c

Please sign in to comment.