forked from graphile/crystal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (38 loc) · 1.66 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
48
49
50
51
FROM node:12-alpine as builder
WORKDIR /postgraphile/
# Add yarn ASAP because it's the slowest
COPY package.json yarn.lock /postgraphile/
RUN yarn install --frozen-lockfile --production=false --no-progress
# Now for PostGraphiQL's yarn
COPY postgraphiql/ /postgraphile/postgraphiql/
WORKDIR /postgraphile/postgraphiql/
RUN yarn install --frozen-lockfile --production=false --no-progress
WORKDIR /postgraphile/
# Copy everything else we need; this stuff will likely change
COPY tsconfig.json .eslintrc.js .eslintignore prettier.config.js .prettierignore /postgraphile/
COPY index.js cli.js /postgraphile/
COPY *.md /postgraphile/
COPY src/ /postgraphile/src/
COPY assets/ /postgraphile/assets/
COPY typings/ /postgraphile/typings/
COPY scripts/ /postgraphile/scripts/
# Finally run the build script
RUN ./scripts/build
########################################
FROM node:12-alpine as clean
# Again, install yarn ASAP because it's the slowest
COPY package.json yarn.lock /postgraphile/
COPY *.md /postgraphile/
COPY index.js cli.js isTurbo.js plugins.js plugins.d.ts /postgraphile/
COPY docker/.postgraphilerc.js /postgraphile/
COPY --from=builder /postgraphile/build/ /postgraphile/build/
COPY --from=builder /postgraphile/build-turbo/ /postgraphile/build-turbo/
COPY --from=builder /postgraphile/sponsors.json /postgraphile/
########################################
FROM node:12-alpine
LABEL description="Instant extensible high-performance GraphQL API for your PostgreSQL database https://graphile.org/postgraphile"
EXPOSE 5000
WORKDIR /postgraphile/
ENTRYPOINT ["./cli.js"]
COPY --from=clean /postgraphile/ /postgraphile/
RUN yarn install --frozen-lockfile --production=true --no-progress