Commit dae5ae1b authored by Felix Bartels's avatar Felix Bartels

add makefile for quick iterations

Signed-off-by: Felix Bartels's avatarFelix Bartels <felix@host-consultants.de>
parent ce40292d
......@@ -6,12 +6,16 @@ EXPOSE 8080
ENV STATPING_DIR=/app/data
# add supervisor configs
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
COPY supervisor-statping.conf /etc/supervisor/conf.d/
RUN apt-get update && \
apt-get install -y sass && \
rm -rf /var/cache/apt /var/lib/apt/lists
WORKDIR /app/pkg
ARG STATPING_VERSION=0.90.42
ARG STATPING_VERSION=0.90.44
RUN curl -L https://github.com/statping/statping/releases/download/v$STATPING_VERSION/statping-linux-amd64.tar.gz | tar -xz -f - && \
echo "Statping is verion $(/app/pkg/statping version)"
......
CLOUDRON_APP ?= status
CLOUDRON_ID := $(shell jq -r .id CloudronManifest.json)
DOCKER_REPO ?= fbartels
.PHONY: default
default: build update
.PHONY: init
init:
cloudron init
.PHONY: build
build:
cloudron build --set-repository $(DOCKER_REPO)/$(CLOUDRON_ID)
.PHONY: update
update: build
cloudron update --app ${CLOUDRON_APP}
.PHONY: install
install:
cloudron install --location ${CLOUDRON_APP}
.PHONY: uninstall
uninstall:
cloudron uninstall --app ${CLOUDRON_APP}
.PHONY: install-debug
install-debug:
cloudron install --location ${CLOUDRON_APP} --debug
.PHONY: exec
exec:
cloudron exec --app ${CLOUDRON_APP}
.PHONY: logs
logs:
cloudron logs -f --app ${CLOUDRON_APP}
......@@ -16,8 +16,8 @@ random_string() {
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c32
}
if [ ! -e /app/data/environment ]; then
cat <<-EOF > "/app/data/environment"
if [ ! -e /app/data/.env ]; then
cat <<-EOF > "/app/data/.env"
# Config file to load
NAME="Cloudron"
DESCRIPTION="Status overview"
......@@ -29,9 +29,9 @@ API_SECRET=$(random_string)
EOF
fi
# export all values from "environment"
# export all values from ".env"
set -a
. /app/data/environment
. /app/data/.env
set +x
if [ ! -e /app/data/services.yml ]; then
......@@ -76,4 +76,7 @@ services:
EOF
fi
exec /app/pkg/statping
echo "=> Ensure permissions"
chown -R cloudron:cloudron /run /app/data
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i statping
[program:statping]
command=/app/pkg/statping
user=cloudron
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment