forked from GMOD/Apollo3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89ccf49
commit a797a59
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:18 AS setup | ||
FROM node:18-alpine AS build | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock .yarnrc.yml ./ | ||
COPY .yarn/ .yarn/ | ||
COPY packages/ packages/ | ||
RUN find packages/ -type f \! \( -name "package.json" -o -name "yarn.lock" \) -delete && \ | ||
find . -type d -empty -delete | ||
|
||
FROM node:18 AS build | ||
WORKDIR /app | ||
COPY --from=setup /app . | ||
RUN find packages/ -type f \! \( -name "package.json" -o -name "yarn.lock" \) -delete | ||
RUN find . -type d -empty -delete | ||
RUN yarn install --immutable | ||
COPY . . | ||
WORKDIR /app/packages/apollo-collaboration-server | ||
RUN yarn build | ||
|
||
FROM node:18 | ||
LABEL org.opencontainers.image.source=https://github.com/GMOD/Apollo3 | ||
LABEL org.opencontainers.image.description="Apollo collaboration server" | ||
FROM node:18-alpine | ||
WORKDIR /app | ||
COPY --from=setup /app . | ||
COPY --from=build /app/packages/apollo-collaboration-server/dist /app/packages/apollo-collaboration-server/dist | ||
COPY --from=build /app/packages/apollo-common/dist /app/packages/apollo-common/dist | ||
COPY --from=build /app/packages/apollo-mst/dist /app/packages/apollo-mst/dist | ||
COPY --from=build /app/packages/apollo-schemas/dist /app/packages/apollo-schemas/dist | ||
COPY --from=build /app/packages/apollo-shared/dist /app/packages/apollo-shared/dist | ||
COPY --from=build /app/packages/apollo-shared/package.json /app/packages/apollo-shared/package.json | ||
COPY --from=build /app/packages/apollo-schemas/package.json /app/packages/apollo-schemas/package.json | ||
COPY --from=build /app/packages/apollo-mst/package.json /app/packages/apollo-mst/package.json | ||
COPY --from=build /app/packages/apollo-common/package.json /app/packages/apollo-common/package.json | ||
COPY --from=build /app/packages/apollo-collaboration-server/package.json /app/packages/apollo-collaboration-server/package.json | ||
COPY --from=build /app/package.json /app/package.json | ||
COPY --from=build /app/yarn.lock /app/yarn.lock | ||
COPY --from=build /app/.yarnrc.yml /app/.yarnrc.yml | ||
COPY --from=build /app/.yarn/ /app/.yarn/ | ||
RUN yarn workspaces focus --production @apollo-annotation/collaboration-server | ||
|
||
EXPOSE 3999 | ||
CMD ["yarn", "start:prod"] |