Skip to content

Commit 5b24d41

Browse files
committed
test
1 parent aa47c0b commit 5b24d41

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed

.github/workflows/deploy.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to AWS Lambda
1+
name: Deploy
22

33
on:
44
push:
@@ -38,3 +38,23 @@ jobs:
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+

admission-api/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SMTP_PASSWORD=
99
FRONTEND_URL=
1010
LAMBDA_TASK_ROOT=
1111

12-
NODE_ENV
12+
NODE_ENV=
1313

1414
ADMISSION_BOT_API=
1515
ADMISSION_BOT_TOKEN=

frontend.Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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"]

0 commit comments

Comments
 (0)