forked from curtgrimes/webcaptioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (31 loc) · 1.14 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
FROM node:12.2
# Force binary name because the current linux architecture
# wasn't available on GitHub as a prebuilt binary
# ENV SASS_BINARY_NAME linux-x64-59_binding.node
ENV GOOGLE_APPLICATION_CREDENTIALS ./app/config/google-application-credentials.json
ARG SENTRY_AUTH_TOKEN_PRIVATE
# Install Hugo
ADD https://github.com/gohugoio/hugo/releases/download/v0.37.1/hugo_0.37.1_Linux-64bit.tar.gz /tmp
RUN tar -xf /tmp/hugo_0.37.1_Linux-64bit.tar.gz -C /tmp \
&& mkdir -p /usr/local/sbin \
&& mv /tmp/hugo /usr/local/sbin/hugo \
&& rm -rf /tmp/hugo_0.37.1_linux_amd64
WORKDIR /usr/src
# Install app dependencies
COPY ./app/package*.json ./app/
COPY ./static-site/package*.json ./static-site/
RUN set -ex \
&& npm install --prefix ./app ./app \
&& npm install --prefix ./static-site ./static-site
# Copy the rest of the files
COPY . ./
# Build
# EVERYTHING THAT HAPPENS HERE MUST BE
# ENVIRONMENT-AGNOSTIC
RUN set -ex \
&& npm run build --prefix ./app \
&& hugo --source="./static-site" \
&& npm run build --prefix ./static-site \
&& npm prune --production --prefix ./app
EXPOSE 8080
CMD ["bash","/usr/src/scripts/run.sh"]