try use docker

This commit is contained in:
2026-02-19 11:10:32 +09:00
parent 3d2de67d1e
commit 366a11814c
10 changed files with 131 additions and 66 deletions

19
backend/.dockerignore Normal file
View File

@@ -0,0 +1,19 @@
# Versioning and metadata
.git
.gitignore
.dockerignore
# Build dependencies
dist
node_modules
coverage
# Environment (contains sensitive data)
.env
# Files not required for production
.editorconfig
Dockerfile
README.md
.eslintrc.js
nodemon.json

View File

@@ -1,7 +1,7 @@
NODE_ENV=development
HOST=0.0.0.0
PORT=3000
APP_URL=http://localhost:3000
PORT=3001
APP_URL=http://localhost:3001
# Database
DB_HOST=localhost
@@ -36,3 +36,6 @@ SMTP_PASS=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback
FRONTEND_URL=http://localhost:3000

14
backend/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM node:20-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS production
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=base /app/dist ./dist
EXPOSE 3001
CMD ["node", "dist/main.js"]