forked from fossasia/open-event-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (31 loc) · 839 Bytes
/
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
FROM node:12-alpine as builder
WORKDIR /app
RUN apk add git python-dev make g++ gettext
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
ARG api_host
ARG google_api_key
ENV API_HOST=$api_host
ENV GOOGLE_API_KEY=$google_api_key
RUN node scripts/l10n.js generate && \
touch .env && \
JOBS=1 yarn build -prod
##
##
FROM node:12-alpine
WORKDIR /fastboot
COPY --from=builder /app/dist/ dist/
RUN apk add --no-cache ca-certificates nginx && \
cp dist/package.json . && \
yarn install && \
yarn add fastboot-app-server dotenv lodash && \
rm -rf yarn.lock && \
yarn cache clean
COPY scripts/* ./scripts/
COPY config/environment.js ./config/
RUN rm /etc/nginx/conf.d/default.conf
COPY config/nginx.conf /etc/nginx/conf.d
RUN mkdir -p /run/nginx
EXPOSE 4000
CMD ["sh", "scripts/container_start.sh"]