-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
45 lines (39 loc) · 1.35 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
# Prepare packages
FROM node:14-slim as node-build
WORKDIR /app
ADD package.json yarn.lock ./
ADD actions/package.json ./actions/
ADD auth/package.json ./auth/
ADD web/package.json ./web/
RUN yarn install --frozen-lockfile
ADD web/ ./web/
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1
RUN cd web && yarn next build && cd ..
RUN yarn install --frozen-lockfile --prod
ADD actions/ ./actions/
ADD auth/ ./auth/
ADD composite-service.js ./
# Base this image on hasura graphql engine (CLI migrations version)
FROM hasura/graphql-engine:v2.0.9.cli-migrations-v3
# Install Node.js
RUN apt-get update \
&& apt-get -y install curl gnupg2 \
&& curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get -y install nodejs \
&& apt-get -y remove curl gnupg2 \
&& apt-get -y auto-remove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/doc/ \
&& rm -rf /usr/share/man/ \
&& rm -rf /usr/share/locale/
# Copy hasura migrations & metadata
COPY hasura/metadata /hasura-metadata/
COPY hasura/migrations /hasura-migrations/
# Copy packages
COPY --from=node-build /app /app
ENV NODE_ENV=production ACTIONS_URL=foo
# "NODE_ENV=production" signals production mode
# "ACTIONS_URL=foo" prevents warnings in cli-migrations startup (ACTIONS_URL is actually defined in main-server.js)
# Start main server
CMD node /app/composite-service.js