From c9d9e659463465b7a50d800c10e4832918cf44e2 Mon Sep 17 00:00:00 2001 From: choidabom Date: Mon, 30 Sep 2024 23:56:29 +0900 Subject: [PATCH] Delete ./backend/Dockerfile --- backend/Dockerfile | 77 -------------------------- backend/docker/docker-compose-full.yml | 2 +- 2 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 backend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile deleted file mode 100644 index 81c3859d..00000000 --- a/backend/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -# Stage 1: build codepair backend -# Start from the node base image -FROM node:alpine3.18 AS builder -# Set pnpm installation directory and add it to the PATH -ENV PNPM_HOME="/pnpm" -ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable - -# Set the Current Working Directory inside the container -WORKDIR /app - -# Copy the source from the current directory to the Working Directory inside the container -COPY . . - -# Download dependency for Prisma -RUN apk upgrade --update-cache --available && \ - apk add openssl && \ - rm -rf /var/cache/apk/* - -# Download dependencies for Puppeteer -RUN apk add --no-cache \ - chromium \ - nss \ - freetype \ - harfbuzz \ - ca-certificates \ - ttf-freefont - -# Install dependencies -RUN pnpm i - -# Build codepair backend -RUN pnpm run build - -# Stage 2: copy build outputs and dependencies for actual image -FROM node:alpine3.18 -# Set pnpm installation directory and add it to the PATH -ENV PNPM_HOME="/pnpm" -ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable - -# Set the Current Working Directory inside the container -WORKDIR /app - -# Get and copy the build outputs from the builder stage -COPY --from=builder /app ./ - -# Download dependency for Prisma -RUN apk upgrade --update-cache --available && \ - apk add openssl && \ - rm -rf /var/cache/apk/* - -# Download dependencies for Puppeteer -RUN apk add --no-cache \ - chromium \ - nss \ - freetype \ - harfbuzz \ - ca-certificates \ - ttf-freefont - -# Download Korean font for Puppeteer -RUN mkdir /usr/share/fonts/nanumfont && \ - wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip && \ - unzip NanumFont_TTF_ALL.zip -d /usr/share/fonts/nanumfont && \ - fc-cache -f -v - -# Set the environment variables -ENV NODE_ENV production -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true -ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser - -# Expose port 3000 to the outside world -EXPOSE 3000 - -# Run the backend server -CMD ["pnpm", "run", "start:prod"] diff --git a/backend/docker/docker-compose-full.yml b/backend/docker/docker-compose-full.yml index fa0a23df..f78c0f80 100644 --- a/backend/docker/docker-compose-full.yml +++ b/backend/docker/docker-compose-full.yml @@ -3,7 +3,7 @@ version: "3.8" services: codepair-backend: build: - context: ../ + context: ../../ environment: DATABASE_URL: "mongodb://mongo:27017/codepair" # Environment variables need to be passed to the container