This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
44 lines (39 loc) · 1.73 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# hadolint ignore=DL3007
FROM mhart/alpine-node:latest
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VCS_URL
ARG VCS_REF
ARG VCS_BRANCH
ENV GIT_PROJECT=claudioc/jingo
# See http://label-schema.org/rc1/ and https://microbadger.com/labels
LABEL maintainer="Jan Wagner <[email protected]>" \
org.label-schema.name="jingo - Node.js based Wiki" \
org.label-schema.description="Git based wiki engine written for node.js, with a decent design, a search capability and a good typography on Alpine Linux based container" \
org.label-schema.vendor="Cyconet" \
org.label-schema.schema-version="1.0" \
org.label-schema.build-date="${BUILD_DATE:-unknown}" \
org.label-schema.version="${BUILD_VERSION:-unknown}" \
org.label-schema.vcs-url="${VCS_URL:-unknown}" \
org.label-schema.vcs-ref="${VCS_REF:-unknown}" \
org.label-schema.vcs-branch="${VCS_BRANCH:-unknown}" \
org.opencontainers.image.source="https://github.com/waja/docker-jingo"
# hadolint ignore=DL3017,DL3018
RUN apk --no-cache update && apk --no-cache upgrade && \
# Install dependencies
apk --no-cache add --virtual build-dependencies ca-certificates tar curl jq git && \
# Create directory
mkdir -p /opt/jingo
WORKDIR /opt/jingo
# Download latest release
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN curl -L "$(curl -s https://api.github.com/repos/$GIT_PROJECT/releases/latest | jq -r ".tarball_url")" | tar xz --strip=1 && \
# Install npm dependencies
npm install && \
# Adjust configuration path in package.json script
sed -ri 's#"./jingo -c config.yaml"#"./jingo -c config/config.yaml"#' /opt/jingo/package.json && \
# Create configuration dir
mkdir -p /opt/jingo/config
WORKDIR /opt/jingo
COPY start.sh /opt/jingo/start.sh
CMD ["/bin/sh", "/opt/jingo/start.sh"]