Skip to content

Commit

Permalink
use node alpine and fix Mac issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankbrgowda committed Sep 26, 2024
1 parent 89ccf49 commit 0abc79d
Showing 1 changed file with 91 additions and 11 deletions.
102 changes: 91 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,111 @@
# 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
# RUN find . -type d -empty -delete
# RUN yarn install --immutable
# COPY . .
# WORKDIR /app/packages/apollo-collaboration-server
# RUN yarn build

# FROM node:18-alpine
# WORKDIR /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 package.json yarn.lock .yarnrc.yml ./
# COPY .yarn/ .yarn/
# RUN yarn workspaces focus --production @apollo-annotation/collaboration-server

# EXPOSE 3999
# CMD ["yarn", "start:prod"]

# syntax=docker/dockerfile:1

# FROM node:18 AS setup
# 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
# 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"
# WORKDIR /app
# COPY --from=setup /app .
# COPY --from=setup /app/packages/apollo-collaboration-server/dist /app/packages/apollo-collaboration-server/dist
# COPY --from=setup /app/packages/apollo-common/dist /app/packages/apollo-common/dist
# COPY --from=setup /app/packages/apollo-mst/dist /app/packages/apollo-mst/dist
# COPY --from=setup /app/packages/apollo-schemas/dist /app/packages/apollo-schemas/dist
# COPY --from=setup /app/packages/apollo-shared/dist /app/packages/apollo-shared/dist
# RUN yarn workspaces focus --production @apollo-annotation/collaboration-server
# EXPOSE 3999
# CMD ["yarn", "start:prod"]


# WORKING - 2.5GB
# 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
# RUN find . -type d -empty -delete
# RUN yarn install --immutable
# COPY . .
# WORKDIR /app/packages/apollo-collaboration-server
# RUN yarn build
# EXPOSE 3999
# CMD ["yarn", "start:prod"]
# WORKING


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"]

0 comments on commit 0abc79d

Please sign in to comment.