Skip to content

Commit

Permalink
Merge pull request #17 from linuxserver/nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
j0nnymoe authored Apr 4, 2022
2 parents 80b8e48 + 893420f commit a70dbea
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14

# set version label
ARG BUILD_DATE
Expand Down Expand Up @@ -44,8 +44,7 @@ RUN \
cd /app/babybuddy && \
pip3 install -U --no-cache-dir \
pip && \
pip install lxml --no-binary :all: && \
pip install -U --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
pip install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.14

# set version label
ARG BUILD_DATE
Expand Down Expand Up @@ -44,7 +44,7 @@ RUN \
cd /app/babybuddy && \
pip3 install -U --no-cache-dir \
pip && \
pip install -U --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
pip install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.14

# set version label
ARG BUILD_DATE
Expand Down Expand Up @@ -44,7 +44,7 @@ RUN \
cd /app/babybuddy && \
pip3 install -U --no-cache-dir \
pip && \
pip install -U --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
pip install --no-cache-dir --ignore-installed --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
container_name: babybuddy
environment:
- TZ=Europe/London
- CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000,https://babybuddy.domain.com
volumes:
- /path/to/appdata:/config
ports:
Expand All @@ -92,6 +93,7 @@ services:
docker run -d \
--name=babybuddy \
-e TZ=Europe/London \
-e CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000,https://babybuddy.domain.com \
-p 8000:8000 \
-v /path/to/appdata:/config \
--restart unless-stopped \
Expand All @@ -106,6 +108,7 @@ Container images are configured using parameters passed at runtime (such as thos
| :----: | --- |
| `-p 8000` | the port for the web ui |
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
| `-e CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000,https://babybuddy.domain.com` | Add any address you'd like to access babybuddy at (comma separated, no spaces) |
| `-v /config` | Contains all relevant configuration and data. |

## Environment variables from files (Docker secrets)
Expand Down Expand Up @@ -204,6 +207,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **03.04.22:** - Rebase to alpine-nginx baseimage. Add `CSRF_TRUSTED_ORIGINS` env var.
* **11.12.21:** - Add py3-mysqlclient for mysql/mariadb.
* **14.11.21:** - Add lxml dependencies (temp fix for amd64 by force compiling lxml).
* **25.07.21:** - Add libpq for postgresql.
Expand Down
2 changes: 2 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ param_ports:
param_usage_include_env: true
param_env_vars:
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London" }
- { env_var: "CSRF_TRUSTED_ORIGINS", env_value: "http://127.0.0.1:8000,https://babybuddy.domain.com", desc: "Add any address you'd like to access babybuddy at (comma separated, no spaces)" }

# optional container parameters
opt_param_usage_include_env: false
Expand All @@ -39,6 +40,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "03.04.22:", desc: "Rebase to alpine-nginx baseimage. Add `CSRF_TRUSTED_ORIGINS` env var." }
- { date: "11.12.21:", desc: "Add py3-mysqlclient for mysql/mariadb." }
- { date: "14.11.21:", desc: "Add lxml dependencies (temp fix for amd64 by force compiling lxml)." }
- { date: "25.07.21:", desc: "Add libpq for postgresql." }
Expand Down
24 changes: 24 additions & 0 deletions root/defaults/default
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Version 2022/04/03 - Changelog: https://github.com/linuxserver/docker-babybuddy/commits/main/root/defaults/default

server {
listen 8000 default_server;

server_name _;

client_max_body_size 0;

location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_redirect off;
}

location ^~ /media/ {
root /app/babybuddy/;
}

location ^~ /static/ {
root /app/babybuddy/;
}

}
2 changes: 1 addition & 1 deletion root/etc/cont-init.d/30-config
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ python3 manage.py migrate --noinput
python3 manage.py createcachetable

chown -R abc:abc \
/config
/config
2 changes: 1 addition & 1 deletion root/etc/services.d/babybuddy/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export \
SECRET_KEY="${SECRET_KEY:-`cat /config/.secretkey`}"

exec \
s6-setuidgid abc gunicorn babybuddy.wsgi -b :8000 --log-level=info \
s6-setuidgid abc gunicorn babybuddy.wsgi -b 127.0.0.1:3000 --log-level=info \
--worker-tmp-dir=/dev/shm --log-file=- \
--workers=2 --threads=4 --worker-class=gthread

0 comments on commit a70dbea

Please sign in to comment.