try use docker
This commit is contained in:
19
backend/.dockerignore
Normal file
19
backend/.dockerignore
Normal 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
|
||||
@@ -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
14
backend/Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user