-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (38 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
54 lines (38 loc) · 1.54 KB
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
45
46
47
48
49
50
51
52
53
54
FROM node:stretch
ENV USR_LOCAL=/usr/local
ENV APP_DIR=$USR_LOCAL/app
ENV ENVIRONMENT=dev
ENV TZ=Europe/Berlin
USER root
RUN ln -snf /usr/share/zoneinfo/$TZ/etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install libstdc++6 \
&& apt-get install -y google-chrome-unstable \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb
# Puppeteer v0.13.0 works with Chromium 64.
RUN yarn add puppeteer@1.10.0
RUN npm install -g --unsafe-perm=true gulp hugulp firebase-tools
RUN mkdir $APP_DIR && mkdir $APP_DIR/functions
# Set environment variable
ARG RUN_AS=node
ARG HUGO_VERSION=0.78.0
ARG HUGO_BINARY="hugo_extended_${HUGO_VERSION}_Linux-64bit"
# Download and install hugo
RUN mkdir /usr/local/hugo
ADD https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY}.tar.gz \
/usr/local/hugo/
RUN tar xzf /usr/local/hugo/${HUGO_BINARY}.tar.gz -C /usr/local/hugo/ \
&& ln -s /usr/local/hugo/hugo /usr/local/bin/hugo \
&& rm /usr/local/hugo/${HUGO_BINARY}.tar.gz
RUN chmod 775 -R $USR_LOCAL
COPY package.json $APP_DIR
COPY functions/package.json $APP_DIR/functions
WORKDIR $APP_DIR
RUN npm i
RUN cd functions && npm i