Skip to content
Snippets Groups Projects
Commit 85d70209 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye
Browse files

[WhiteBoard] Some enhancement in Dockerfile et entrypoint

parent 05a24df3
No related branches found
No related tags found
No related merge requests found
FROM node:14.2.0-alpine3.11
ENV WBVERSION=1.5 \
SCVERSION=0.1.9
SCVERSION=0.1.11
RUN mkdir -p /opt/app && \
apk add --no-cache --virtual .download ca-certificates wget && \
RUN apk add --no-cache --virtual .download ca-certificates wget && \
wget https://github.com/cracker0dks/whiteboard/archive/v$WBVERSION.tar.gz && \
wget https://github.com/aptible/supercronic/releases/download/v$SCVERSION/supercronic-linux-amd64 && \
chmod +x supercronic-linux-amd64 && \
mv supercronic-linux-amd64 /usr/local/bin/supercronic && \
tar -C /opt/app -xzf v$WBVERSION.tar.gz && \
tar -C /opt -xzvf v$WBVERSION.tar.gz && \
rm v$WBVERSION.tar.gz && \
cd /opt/app/whiteboard-$WBVERSION && \
mv /opt/whiteboard-$WBVERSION /opt/whiteboard && \
cd /opt/whiteboard && \
npm ci && \
apk del .download
ADD crontab /opt/app/whiteboard-$WBVERSION/crontab
ADD entrypoint.sh /entrypoint.sh
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
......
version: '3'
version: '3.7'
services:
app:
image: wb
whiteboard-app:
image: registry.picasoft.net/pica-whiteboard:1.5
container_name: whiteboard-app
build: .
volumes:
- /etc/localtime:/etc/localtime:ro
networks:
- proxy
labels:
traefik.http.routers.etherpad-app.entrypoints: websecure
traefik.http.routers.etherpad-app.rule: Host(`wb.test.picasoft.net`)
traefik.http.services.etherpad-app.loadbalancer.server.port: 8080
traefik.http.routers.whiteboard-app.entrypoints: websecure
traefik.http.routers.whiteboard-app.rule: Host(`whiteboard.picasoft.net`)
traefik.http.services.whiteboard-app.loadbalancer.server.port: 8080
traefik.enable: true
restart: always
environment:
STOP_APP: "0 0 * * *"
RESTART_APP: "1 0 * * *"
restart: unless-stopped
networks:
proxy:
......
#! /bin/sh
cd /opt/app/whiteboard-1.5
cd /opt/whiteboard
cat << EOF > crontab
$STOP_APP pkill node
$RESTART_APP cd /opt/whiteboard && node server.js --mode=production
EOF
node server.js --mode=production &
supercronic /opt/app/whiteboard-1.5/crontab
supercronic crontab
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment