-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
43 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,26 @@ | ||
# Base Image | ||
# 베이스 이미지 설정 | ||
FROM node:20-alpine3.18 AS phase1 | ||
|
||
# 작업 디렉터리 설정 | ||
WORKDIR /app | ||
|
||
# Copy necessary files | ||
# package.json이 변경될 경우에만 yarn 실행 | ||
COPY --chown=node:node turbo.json . | ||
COPY --chown=node:node tsconfig.json . | ||
COPY --chown=node:node package.json . | ||
|
||
# Create the express-server directory and copy relevant files | ||
# 필요한 디렉터리 생성 | ||
RUN mkdir -p apps/express-server | ||
|
||
# 필요한 패키지 파일만 복사 | ||
COPY --chown=node:node ./apps/express-server/package.json apps/express-server | ||
COPY --chown=node:node ./apps/express-server apps/express-server | ||
|
||
# Environment variables for build arguments | ||
ARG JWT_SECRET | ||
ARG DB_USER | ||
ARG DB_HOST | ||
ARG DB_NAME | ||
ARG DB_PASSWORD | ||
ARG DB_PORT | ||
ARG FRONTEND_URL | ||
ARG DATA_API_KEY | ||
|
||
# Set environment variables for runtime | ||
ENV JWT_SECRET=$JWT_SECRET | ||
ENV DB_USER=$DB_USER | ||
ENV DB_HOST=$DB_HOST | ||
ENV DB_NAME=$DB_NAME | ||
ENV DB_PASSWORD=$DB_PASSWORD | ||
ENV DB_PORT=$DB_PORT | ||
ENV FRONTEND_URL=$FRONTEND_URL | ||
ENV DATA_API_KEY=$DATA_API_KEY | ||
|
||
# Install dependencies | ||
# 종속성 설치 | ||
RUN yarn | ||
|
||
# Build express-server | ||
# express-server 빌드 | ||
RUN yarn build | ||
|
||
# Start the server | ||
# 개발 환경에서 서버 실행 | ||
CMD ["yarn", "workspace", "express-server", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,27 @@ | ||
# Base Image | ||
# 베이스 이미지 설정 | ||
FROM node:20-alpine3.18 AS base | ||
|
||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine | ||
# to understand why libc6-compat might be needed. | ||
# 필요한 종속성 추가 | ||
RUN apk add --no-cache libc6-compat | ||
|
||
# Set working directory | ||
# 작업 디렉터리 설정 | ||
WORKDIR /app | ||
|
||
# Define build-time variables | ||
ARG GOOGLE_CLIENT_ID | ||
ARG GOOGLE_CLIENT_SECRET | ||
ARG NEXTAUTH_SECRET | ||
ARG NEXT_PUBLIC_LOCAL_BACKEND_URL | ||
ARG NEXTAUTH_URL | ||
ARG NEXT_PUBLIC_KAKAO_MAP_KEY | ||
ARG DATA_API_KEY | ||
|
||
# Set environment variables to be used in the container | ||
ENV GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID | ||
ENV GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET | ||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET | ||
ENV NEXT_PUBLIC_LOCAL_BACKEND_URL=$NEXT_PUBLIC_LOCAL_BACKEND_URL | ||
ENV NEXTAUTH_URL=$NEXTAUTH_URL | ||
ENV NEXT_PUBLIC_KAKAO_MAP_KEY=$NEXT_PUBLIC_KAKAO_MAP_KEY | ||
ENV DATA_API_KEY=$DATA_API_KEY | ||
|
||
# Create the next-client directory and copy necessary files | ||
RUN mkdir -p apps/next-client | ||
|
||
# Copy root package.json and yarn.lock | ||
COPY package.json yarn.lock /app/ | ||
|
||
# Copy next-client package.json | ||
COPY ./apps/next-client/package.json /app/apps/next-client/ | ||
|
||
# Copy the rest of the next-client files | ||
COPY ./apps/next-client /app/apps/next-client/ | ||
|
||
# Install dependencies for next-client | ||
WORKDIR /app/apps/next-client | ||
# 패키지 파일 복사 | ||
COPY package.json yarn.lock ./ | ||
COPY apps/next-client/package.json apps/next-client/ | ||
|
||
# 종속성 설치 | ||
RUN yarn --frozen-lockfile | ||
|
||
# Copy the rest of the next-client application code into the container | ||
COPY --chown=node:node ./apps/next-client ./apps/next-client/ | ||
# 애플리케이션 코드 복사 | ||
COPY apps/next-client apps/next-client | ||
|
||
# Build the Next.js app | ||
# Next.js 애플리케이션 빌드 | ||
RUN yarn workspace next-client build | ||
|
||
# Expose the port Next.js app runs on (default is 3000) | ||
# 애플리케이션 실행 포트 공개 (기본값: 3000) | ||
EXPOSE 3000 | ||
|
||
# Start the app | ||
# 애플리케이션 시작 | ||
CMD ["yarn", "workspace", "next-client", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters