-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new Docker setup with s6-overlay (#193)
Fixes #193 * ✨ ⛵ Create new Docker setup with s6-overlay * 👕 Fix errors * 🔨 remove jq * 🔨 Add missing argument * 🔨 Cleanup * 🔨 Copy built app * 🔥 Fix build path * 🔨 remove stage not required * 🚑 Add missing mime types * 🔨 Create nicer default file * 🔨 tweak default file * 🔨 Remove test * ⛵ Update docker-compose file * 🔨 Fix docker-compose volumes * 📚 Update docs for new setup
- Loading branch information
Showing
16 changed files
with
402 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
ARG BUILD_FROM=alpine:3.8 | ||
# hadolint ignore=DL3006 | ||
FROM ${BUILD_FROM} | ||
|
||
# Environment variables | ||
ENV \ | ||
HOME="/root" \ | ||
LANG="C.UTF-8" \ | ||
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" | ||
|
||
# Copy app | ||
COPY build /opt/panel | ||
|
||
# Copy root filesystem | ||
COPY rootfs / | ||
|
||
# Build arch argument | ||
ARG BUILD_ARCH=amd64 | ||
|
||
# Set shell | ||
SHELL ["/bin/ash", "-o", "pipefail", "-c"] | ||
|
||
# Install system | ||
# hadolint ignore=DL3003 | ||
RUN \ | ||
set -o pipefail \ | ||
\ | ||
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ | ||
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \ | ||
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \ | ||
\ | ||
&& apk add --no-cache --virtual .build-dependencies \ | ||
curl=7.61.1-r1 \ | ||
git=2.18.1-r0 \ | ||
tar=1.30-r0 \ | ||
yarn=1.7.0-r0 \ | ||
\ | ||
&& apk add --no-cache \ | ||
apk-tools=2.10.1-r0 \ | ||
bash=4.4.19-r1 \ | ||
busybox=1.28.4-r2 \ | ||
ca-certificates=20171114-r3 \ | ||
nginx=1.14.2-r0 \ | ||
nodejs-current=9.11.1-r2 \ | ||
tzdata=2018f-r0 \ | ||
\ | ||
&& if [ "${BUILD_ARCH}" = "i386" ]; then S6_ARCH="x86"; else S6_ARCH="${BUILD_ARCH}"; fi \ | ||
\ | ||
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-${S6_ARCH}.tar.gz" \ | ||
| tar zxvf - -C / \ | ||
\ | ||
&& mkdir -p /etc/fix-attrs.d \ | ||
\ | ||
&& git clone --depth=1 \ | ||
"https://github.com/timmo001/home-panel-api.git" /opt/api \ | ||
\ | ||
&& cd /opt/api \ | ||
&& yarn install \ | ||
\ | ||
&& yarn cache clean \ | ||
&& apk del --purge .build-dependencies \ | ||
&& rm -fr /tmp/* | ||
|
||
# Entrypoint & CMD | ||
ENTRYPOINT ["/init"] | ||
|
||
# Build arguments | ||
ARG BUILD_DATE | ||
ARG BUILD_REF | ||
ARG BUILD_VERSION | ||
|
||
# Labels | ||
LABEL \ | ||
maintainer="Timmo <contact@timmo.xyz>" \ | ||
org.label-schema.description="A touch-compatible web-app for controlling the home" \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.name="Home Panel" \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.url="https://git.timmo.xyz/home-panel" \ | ||
org.label-schema.usage="https://github.com/timmo001/home-panel/tree/master/README.md" \ | ||
org.label-schema.vcs-ref=${BUILD_REF} \ | ||
org.label-schema.vcs-url="https://github.com/timmo001/home-panel" \ | ||
org.label-schema.vendor="Timmo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
version: '3' | ||
|
||
services: | ||
home-panel: | ||
image: timmo001/home-panel | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# ============================================================================== | ||
# Displays an message right before terminating in case something went wrong | ||
# ============================================================================== | ||
|
||
if [[ "${S6_STAGE2_EXITED}" -ne 0 ]]; then | ||
echo '-----------------------------------------------------------' | ||
echo ' Oops! Something went wrong.' | ||
echo ' Be sure to check the log above, line by line, for hints.' | ||
echo '-----------------------------------------------------------' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/with-contenv bash | ||
# ============================================================================== | ||
# Displays a simple banner on startup | ||
# ============================================================================== | ||
echo '-----------------------------------------------------------' | ||
echo 'Home Panel' | ||
echo '-----------------------------------------------------------' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/with-contenv bash | ||
# ============================================================================== | ||
# Configures NGINX for use with Home Panel | ||
# ============================================================================== | ||
# Enable SSL | ||
if [ -f "$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 |
Oops, something went wrong.