Skip to content

Commit

Permalink
Merge pull request #3317 from SeedCompany/docker-gql-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF authored Oct 23, 2024
2 parents 39cf851 + 83b48ad commit 7513391
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG NODE_VERSION=20
ARG NODE_IMAGE=public.ecr.aws/docker/library/node:${NODE_VERSION}-slim
ARG EDGEDB_IMAGE=ghcr.io/edgedb/edgedb:5

FROM ${NODE_IMAGE} as base-runtime
FROM ${NODE_IMAGE} AS base-runtime

# Install these native packages
RUN apt-get update \
Expand All @@ -19,10 +19,17 @@ RUN apt-get update \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh -s -- -y --no-modify-path \
&& mv /root/.local/bin/edgedb /usr/local/bin/edgedb


# Apollo Rover CLI
RUN curl -sSL https://rover.apollo.dev/nix/latest | sh

# GraphQL Hive CLI
RUN curl -sSL https://graphql-hive.com/install.sh | sh

# Enable yarn via corepack
RUN corepack enable

FROM ${EDGEDB_IMAGE} as builder
FROM ${EDGEDB_IMAGE} AS builder

# region Install NodeJS
ARG NODE_VERSION
Expand Down Expand Up @@ -93,14 +100,17 @@ EOF
# Build server
RUN yarn build

# Generate GraphQL schema
RUN yarn start -- --gen-schema

# Remove non-production files
RUN rm -rf nest-cli.json tsconfig* test
# Remove dev dependencies
RUN yarn workspaces focus --all --production
# Remove yarn cache to reduce image size
RUN yarn cache clean --all

FROM base-runtime as runtime
FROM base-runtime AS runtime

WORKDIR /opt/cord-api

Expand Down

0 comments on commit 7513391

Please sign in to comment.