Skip to content

Commit

Permalink
feat: 샌박 환경 구축
Browse files Browse the repository at this point in the history
  • Loading branch information
miro-ring committed Mar 23, 2024
1 parent 90d8277 commit 2a14ba1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
REPOSITORY: ${{ env.IMAGE_NAME }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --build-arg PORT=3001 .
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --build-arg PORT=3001 -f Dockerfile.sandbox .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Delete old docker image in ECR
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile.sandbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ARG PORT

RUN corepack enable
COPY . /app
WORKDIR /app

FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/ .
EXPOSE ${PORT}
CMD [ "pnpm", "start", "-p", "3001" ]

0 comments on commit 2a14ba1

Please sign in to comment.