File tree Expand file tree Collapse file tree 3 files changed +74
-2
lines changed
Expand file tree Collapse file tree 3 files changed +74
-2
lines changed Original file line number Diff line number Diff line change 1- name : Deploy to AWS Lambda
1+ name : Deploy
22
33on :
44 push :
3838 platforms : linux/amd64,linux/arm64
3939 push : true
4040 tags : ${{ secrets.DOCKER_HUB_USERNAME }}/admission-api:latest
41+ web :
42+ runs-on : ubuntu-latest
43+ steps :
44+ - name : Set up QEMU
45+ uses : docker/setup-qemu-action@v3
46+ - name : Set up Docker Buildx
47+ uses : docker/setup-buildx-action@v3
48+ - name : Log in to Docker Hub
49+ uses : docker/login-action@v3
50+ with :
51+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
52+ password : ${{ secrets.DOCKER_HUB_PASSWORD }}
53+ - name : Build and push app Docker image
54+ uses : docker/build-push-action@v6
55+ with :
56+ platforms : linux/amd64,linux/arm64
57+ file : " {context}/frontend.Dockerfile"
58+ push : true
59+ tags : ${{ secrets.DOCKER_HUB_USERNAME }}/admission-web:latest
60+
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ SMTP_PASSWORD=
99FRONTEND_URL =
1010LAMBDA_TASK_ROOT =
1111
12- NODE_ENV
12+ NODE_ENV =
1313
1414ADMISSION_BOT_API =
1515ADMISSION_BOT_TOKEN =
Original file line number Diff line number Diff line change 1+ ARG NODE_VERSION=18.18.0
2+
3+ # Alpine image
4+ FROM node:${NODE_VERSION}-alpine AS alpine
5+ RUN apk update
6+ RUN apk add --no-cache libc6-compat
7+
8+ # Setup pnpm and turbo on the alpine base
9+ FROM alpine AS base
10+ RUN npm install turbo --global
11+ RUN corepack enable && corepack prepare yarn@4.3.1
12+
13+ # Prune projects
14+ FROM base AS pruner
15+
16+ WORKDIR /app
17+ COPY . .
18+ RUN turbo prune --scope=admission-web --scope=@admission/utils --docker
19+
20+ # Build the project
21+ FROM base AS builder
22+
23+ WORKDIR /app
24+
25+ # Copy lockfile and package.json's of isolated subworkspace
26+ COPY --from=pruner /app/out/yarn.lock ./yarn.lock
27+ COPY --from=pruner /app/out/json/ .
28+
29+ # First install the dependencies (as they change less often)
30+ RUN yarn install
31+
32+ # Copy source code of isolated subworkspace
33+ COPY --from=pruner /app/out/full/ .
34+
35+ RUN turbo build --filter=admission-web
36+ RUN yarn workspaces focus --all --production
37+
38+ # Final image
39+ FROM alpine AS runner
40+ ARG PROJECT
41+
42+ RUN addgroup --system --gid 1001 nodejs
43+ RUN adduser --system --uid 1001 nodejs
44+ USER nodejs
45+
46+ WORKDIR /app
47+ COPY --from=builder /app/admission-web/.next ./.next
48+ COPY --from=builder /app/node_modules ./node_modules
49+ COPY --from=builder /app/admission-web/public ./public
50+ COPY --from=builder /app/admission-web/package.json ./package.json
51+
52+ CMD ["yarn" , "start" ]
You can’t perform that action at this time.
0 commit comments