mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 14:37:49 +00:00
User Supervisord for logging
This commit is contained in:
parent
497ecc90a8
commit
d300ec6baf
@ -1,7 +1,7 @@
|
||||
FROM resin/i386-ubuntu:14.04
|
||||
|
||||
# Install.
|
||||
RUN apt-get update && apt-get install -y curl git unzip wget npm nodejs inetutils-ping openvpn libsqlite3-dev socat
|
||||
RUN apt-get update && apt-get install -y curl git unzip wget npm nodejs inetutils-ping openvpn libsqlite3-dev socat supervisor
|
||||
RUN ln -sf /usr/bin/nodejs /usr/bin/node
|
||||
|
||||
ADD . /app
|
||||
|
@ -1,6 +1,6 @@
|
||||
FROM dockerfile/nodejs
|
||||
|
||||
RUN apt-get -q update && apt-get install -qqy openvpn libsqlite3-dev socat
|
||||
RUN apt-get -q update && apt-get install -qqy openvpn libsqlite3-dev socat supervisor
|
||||
|
||||
ADD . /app
|
||||
|
||||
|
2
Makefile
2
Makefile
@ -37,7 +37,7 @@ ifneq ($(SUPERVISOR_BASE_PRESENT) , )
|
||||
else
|
||||
docker pull $(BUILDSTEP_REPO):$(BUILDSTEP_VERSION)
|
||||
-docker rm -f build-supervisor-base 2> /dev/null
|
||||
docker run --name build-supervisor-base $(BUILDSTEP_REPO):$(BUILDSTEP_VERSION) bash -c "apt-get -q update && apt-get install -qqy openvpn libsqlite3-dev socat && apt-get clean && rm -rf /var/lib/apt/lists/"
|
||||
docker run --name build-supervisor-base $(BUILDSTEP_REPO):$(BUILDSTEP_VERSION) bash -c "apt-get -q update && apt-get install -qqy openvpn libsqlite3-dev socat supervisor && apt-get clean && rm -rf /var/lib/apt/lists/"
|
||||
docker commit build-supervisor-base resin/supervisor-base:$(BUILDSTEP_VERSION)
|
||||
-docker rm build-supervisor-base 2> /dev/null
|
||||
endif
|
||||
|
8
entry.sh
8
entry.sh
@ -15,4 +15,10 @@ if [ -d "$DATA_DIRECTORY" ]; then
|
||||
chmod +x $DATA_DIRECTORY/enter.sh
|
||||
fi
|
||||
|
||||
exec node src/supervisor.js &> /var/log/supervisor.log
|
||||
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
||||
|
||||
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||
|
||||
supervisorctl start resin-supervisor
|
||||
|
||||
tail -f /var/log/supervisor/supervisord.log
|
||||
|
@ -1,6 +1,9 @@
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
# Copy supervisord launch file for resin-supervisor
|
||||
cp /app/resin-supervisor.conf /etc/supervisor/conf.d/resin-supervisor.conf
|
||||
|
||||
if [ $NODE_ENV == 'production' ]; then
|
||||
chmod +x src/enterContainer.sh
|
||||
|
||||
|
10
resin-supervisor.conf
Normal file
10
resin-supervisor.conf
Normal file
@ -0,0 +1,10 @@
|
||||
[program:resin-supervisor]
|
||||
directory=/app
|
||||
command=node src/supervisor.js
|
||||
redirect_stderr=true
|
||||
autorestart=true
|
||||
autostart=false
|
||||
stdout_logfile=/var/log/resin_supervisor_stdout.log
|
||||
stderr_logfile=/var/log/resin_supervisor_error.log
|
||||
stdout_logfile_maxbytes=2MB
|
||||
stdout_logfile_backups=5
|
@ -33,6 +33,7 @@ config.supervisorContainer =
|
||||
'/data': {}
|
||||
'/run/docker.sock': {}
|
||||
'/mnt/fib_trie': {}
|
||||
'/var/log': {}
|
||||
Binds: [
|
||||
config.configMountPoint + ':/boot/config.json'
|
||||
'/var/run/docker.sock:/run/docker.sock'
|
||||
|
Loading…
Reference in New Issue
Block a user