-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (35 loc) · 2.18 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
45
46
47
FROM node:8.4.0
RUN mkdir /build-app
WORKDIR /build-app
# Copy all local files into the image.
COPY ./package.json .
COPY ./package-lock.json .
RUN npm install
COPY ./public ./public
COPY ./src ./src
COPY ./tsconfig.json .
COPY ./tslint.json .
COPY ./.env .
RUN npm run build --production
# ============================================================
FROM node:8.6.0-alpine
RUN mkdir /app
WORKDIR /app
COPY --from=0 /build-app/build .
# Build for production.
RUN npm config set unsafe-perm true
RUN npm install -g serve@6.5.3
ENV REACT_APP_PRIMARY_COLOR=#269075
ENV REACT_APP_TEXT_EN_TITLE="We care for your data"
ENV REACT_APP_TEXT_EN_LEADER_TEXT="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam consequatur cumque dolorem doloribus esse exercitationem fugit molestias possimus recusandae vitae?"
ENV REACT_APP_TEXT_NL_TITLE="Wij houden van jouw data"
ENV REACT_APP_TEXT_NL_LEADER_TEXT="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam consequatur cumque dolorem doloribus esse exercitationem fugit molestias possimus recusandae vitae?"
ENV REACT_APP_DEFAULT_HERO_IMAGE=/assets/_tmp/header--library.jpg
ENV REACT_APP_LOGO_URL=/assets/logo-timbuctoo.svg
ENV REACT_APP_TEXT_EN_APP_TITLE=Timbuctoo
ENV REACT_APP_TEXT_NL_APP_TITLE=Timbuctoo
ENV REACT_APP_BACKEND_URL=https://data.anansi.clariah.nl
# Set the command to start the node server.
CMD sh -c 'echo "window.dynamicEnv = {REACT_APP_BACKEND_URL: '"'"'$REACT_APP_BACKEND_URL'"'"', REACT_APP_HIDE_OWN_DATASETS: '"'"'$REACT_APP_HIDE_OWN_DATASETS'"'"', REACT_APP_PRIMARY_COLOR: '"'"'$REACT_APP_PRIMARY_COLOR'"'"', REACT_APP_TEXT_EN_TITLE: '"'"'$REACT_APP_TEXT_EN_TITLE'"'"', REACT_APP_TEXT_EN_LEADER_TEXT: '"'"'$REACT_APP_TEXT_EN_LEADER_TEXT'"'"', REACT_APP_TEXT_NL_TITLE: '"'"'$REACT_APP_TEXT_NL_TITLE'"'"', REACT_APP_TEXT_NL_LEADER_TEXT: '"'"'$REACT_APP_TEXT_NL_LEADER_TEXT'"'"', REACT_APP_DEFAULT_HERO_IMAGE: '"'"'$REACT_APP_DEFAULT_HERO_IMAGE'"'"', REACT_APP_LOGO_URL: '"'"'$REACT_APP_LOGO_URL'"'"', REACT_APP_TEXT_EN_APP_TITLE: '"'"'$REACT_APP_TEXT_EN_APP_TITLE'"'"', REACT_APP_TEXT_NL_APP_TITLE: '"'"'$REACT_APP_TEXT_NL_APP_TITLE'"'"'};" > dynamic_env.js && serve -s -p 80'
# Tell Docker about the port we'll run on.
EXPOSE 80