diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7d620e7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +npm-debug.log +.git +.env +keys.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7993b90 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:20-alpine + +# 앱 디렉터리 생성 +WORKDIR /usr/src/app + +# 앱 의존성 설치 +# package.json과 package-lock.json을 모두 복사 +COPY package*.json ./ + +# 패키지 설치 +RUN npm install + +# 앱 소스 추가 +COPY . . + +# 포트 매핑 (기본 4000포트 사용) +ENV PORT=4000 +EXPOSE 4000 + +# 앱 실행 +CMD [ "npm", "start" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3f63f30 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + headless-login-app: + build: . + container_name: headless-login-demo + ports: + - "4000:4000" + env_file: + - .env + volumes: + - ./keys.json:/usr/src/app/keys.json + restart: unless-stopped