Verified Commit 92754696 authored by aguestuser's avatar aguestuser
Browse files

[101] add docker tooling for splash app

parent 876ca16e
......@@ -21,7 +21,9 @@
"dev": "docker-compose -f docker-compose-dev.yml up",
"start": "docker-compose up -d",
"stop": "docker-compose down",
"update": "./bin/dev/update"
"update": "./bin/dev/update",
"splash:dev": "cd splash && docker-compose -f docker-compose-dev.yml up",
"splash:prod": "cd splash && docker-compose up"
},
"engines": {
"node": "10.16.3"
......
#!/usr/bin/env bash
pushd `pwd`> /dev/null # store current dir
cd `dirname "$0"` # cd to script path
cd ..
echo "--- rebuilding splash page docker image..."
docker build -t signalboost_splash:latest -f ./docker/signalboost_splash.dockerfile .
echo "--- ...rebuilt signald docker image!"
echo "--- DONE!"
pushd > /dev/null
#!/usr/bin/env bash
echo "--- running splash app..."
gatsby develop -H 0.0.0.0
#!/usr/bin/env bash
echo "--- running splash site..."
gatsby build && gatsby serve -H 0.0.0.0
version: '3'
services:
splash:
image: signalboost_splash
container_name: signalboost_splash
entrypoint: "gatsby develop -H 0.0.0.0"
env_file: .env
environment:
NODE_ENV: development
VIRTUAL_HOST: "$SPLASH_VIRTUAL_HOST"
LETSENCRYPT_HOST: "$SPLASH_LETSENCRYPT_HOST"
ports:
- 8000:8000
networks:
- default
volumes:
- ./:/splash
restart: unless-stopped
version: '3'
networks:
proxy-tier:
volumes:
certs:
html:
vhost.d:
services:
splash:
image: signalboost_splash
container_name: signalboost_splash
entrypoint: "/splash/bin/entrypoint/prod"
env_file: .env
environment:
NODE_ENV: development
VIRTUAL_HOST: "$SPLASH_VIRTUAL_HOST"
LETSENCRYPT_HOST: "$SPLASH_LETSENCRYPT_HOST"
ports:
- 9000:9000
networks:
- default
volumes:
- ./:/splash
restart: unless-stopped
proxy:
image: jwilder/nginx-proxy:alpien
container_name: proxy
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- certs:/etc/nginx/certs:ro
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
restart: unless-stopped
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: unless-stopped
volumes:
- certs:/etc/nginx/certs
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy
FROM debian:buster
MAINTAINER Team Friendo <team-friendo@riseup.net>
LABEL Description="Image for running a signal-boost service overlaid on top of signal-cli."
# ------------------------------------------------------
# --- Install System Dependencies
# ------------------------------------------------------
ENV ARCH "x64"
RUN mkdir -p /usr/share/man/man1
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-transport-https \
build-essential \
curl \
git \
gnupg \
libpq-dev \
locales \
netcat-openbsd \
procps \
pkg-config \
python \
xz-utils \
wget \
--fix-missing
# ------------------------------------------------------
# --- Set locale (necessary for proper UTF-8 encoding)
# ------------------------------------------------------
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
# ------------------------------------------------------
# --- Install Node.js
# ------------------------------------------------------
ENV NODE_VERSION 10.16.3
ENV YARN_VERSION 1.17.3
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
# whitelist release signing keys
# node release keys listed at: https://github.com/nodejs/node#release-keys
# yarn release key (6A010c516)listed... where?
RUN set -ex \
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
77984A986EBC2AA786BC0F66B01FBB92821C587A \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
4ED778F539E3634C779C87C6D7062848A1AB005C \
A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
B9E2F5981AA6E0CD28160D9FF13993A75599653C \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done
# retrieve node
RUN set -ex \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
# retrieve yarn
RUN set -ex \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz
# ------------------------------------------------------
# --- Configure Environment
# ------------------------------------------------------
RUN yarn global add gatsby-cli
WORKDIR /signalboost
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