Skip to content

Commit

Permalink
Keep dev dockerfile up to date with main
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Oct 4, 2024
1 parent 89ccf49 commit 6fb5644
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
tag:
description: 'Image tag'
required: true
default: 'devel'
default: 'dev'
type: choice
options:
- devel
- dev
- latest

jobs:
Expand All @@ -35,19 +35,22 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Apollo CLI image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/arm64/v8,linux/amd64
push: true
tags: ghcr.io/gmod/apollo-cli:${{ inputs.tag }}
context: packages/apollo-cli
file:
${{ inputs.tag == 'dev' && 'packages/apollo-cli/dev.Dockerfile' ||
'packages/apollo-cli/Dockerfile' }}
outputs:
type=image,annotation-index.org.opencontainers.image.description=
Apollo CLI
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline
- name: Build and push Apollo collaboration server image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/arm64/v8,linux/amd64
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
uses: ./.github/workflows/docker.yml
with:
tag: devel
tag: dev
secrets: inherit
deploy:
needs: [docker]
Expand Down
32 changes: 32 additions & 0 deletions packages/apollo-cli/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# syntax=docker/dockerfile:1

FROM node:20-alpine 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 && \
find . -type d -empty -delete

FROM node:20-alpine AS build
WORKDIR /app
COPY --from=setup /app .
RUN yarn install --immutable
COPY . .
WORKDIR /app/packages/apollo-shared
RUN yarn build
WORKDIR /app/packages/apollo-cli
RUN yarn build

FROM node:20-alpine
LABEL org.opencontainers.image.source=https://github.com/GMOD/Apollo3
LABEL org.opencontainers.image.description="Apollo CLI"
WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/ .yarn/
COPY packages/apollo-cli packages/apollo-cli
COPY --from=build /app/packages/apollo-cli/dist ./packages/apollo-cli/dist
RUN yarn workspaces focus --production @apollo-annotation/cli
WORKDIR /app/packages/apollo-cli
ENV APOLLO_DISABLE_CONFIG_CREATE=1
ENTRYPOINT ["yarn", "node", "bin/run.js"]

0 comments on commit 6fb5644

Please sign in to comment.