Skip to content

Commit

Permalink
⛵ 📚 Update docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Jan 27, 2019
1 parent 583dba1 commit 3d53bec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
5 changes: 1 addition & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ ENV \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1 \
TERM="xterm" \
SSL="false" \
SSL_CERTFILE="/data/ssl/fullchain.pem" \
SSL_KEYFILE="/data/ssl/privkey.pem"
TERM="xterm"

# Copy app
COPY build /opt/panel
Expand Down
9 changes: 6 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ version: '3'

services:
home-panel:
image: timmo001/home-panel
image: timmo001/home-panel:edge
environment:
SSL_CERTFILE: fullchain.pem
SSL_KEYFILE: privkey.pem
ports:
- 3234:3234
- 8234:8234
volumes:
- ~/home-panel-config.json:/data/config.json
- ~/ssl/fullchain.pem:/data/ssl/fullchain.pem
- ~/ssl/privkey.pem:/data/ssl/privkey.pem
- ~/ssl/fullchain.pem:/ssl/fullchain.pem
- ~/ssl/privkey.pem:/ssl/privkey.pem
4 changes: 2 additions & 2 deletions docker/rootfs/etc/cont-init.d/10-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configures NGINX for use with Home Panel
# ==============================================================================
# Enable SSL
if [ -f "$SSL_CERTFILE" ]; then
if [[ -z "$SSL_CERTFILE" ]]; then
sed -i "s/%%certfile%%/${SSL_CERTFILE}/g" /etc/nginx/nginx-ssl.conf
sed -i "s/%%keyfile%%/${SSL_KEYFILE}/g" /etc/nginx/nginx-ssl.conf
fi
fi
4 changes: 2 additions & 2 deletions docker/rootfs/etc/services.d/api/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ cd /opt/api

DB_PATH=/data/home-panel.db
CONFIG_PATH=/data/config.json
SSL_PATH_CERT=%SSL_CERTFILE%
SSL_PATH_KEY=%SSL_KEYFILE%
SSL_PATH_CERT=/ssl/%SSL_CERTFILE%
SSL_PATH_KEY=/ssl/%SSL_KEYFILE%

export DB_PATH
export CONFIG_PATH
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ version: '3'
services:
home-panel:
image: timmo001/home-panel
environment:
SSL_CERTFILE: fullchain.pem
SSL_KEYFILE: privkey.pem
ports:
- 3234:3234
- 8234:8234
Expand Down Expand Up @@ -86,6 +89,8 @@ docker run -d \
-v PATH_TO_CONFIG/home-panel-config.json:/data/config.json
-v ~/ssl/fullchain.pem:/data/ssl/fullchain.pem
-v ~/ssl/privkey.pem:/data/ssl/privkey.pem
-e SSL_CERTFILE=fullchain.pem \
-e SSL_KEYFILE=privkey.pem \
timmo001/home-panel
```

Expand Down

0 comments on commit 3d53bec

Please sign in to comment.