Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM node:20

# 1. Build Stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build

RUN yarn install
# 2. Run Stage
FROM node:20-alpine
WORKDIR /app

COPY . .
COPY --from=builder /app/package.json /app/yarn.lock ./
COPY --from=builder /app/dist ./dist

RUN yarn build
RUN yarn install --production --frozen-lockfile

EXPOSE 3000

CMD ["yarn", "start:dev"]
CMD ["node", "dist/src/main.js"]
14 changes: 0 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,3 @@ services:
- '3000:3000'
env_file:
- .env

mysql:
image: mysql:8.0
restart: always
container_name: univent-db
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
ports:
- '${DB_HOST_PORT}:${DB_CONTAINER_PORT}'
volumes:
- db-data:/var/lib/mysql

volumes:
db-data:
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"start:prod": "node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand All @@ -35,7 +35,7 @@
"@nestjs/cqrs": "^11.0.3",
"@nestjs/jwt": "^11.0.2",
"@nestjs/passport": "^11.0.5",
"@nestjs/platform-express": "^11.1.9",
"@nestjs/platform-express": "^11.1.11",
"@nestjs/swagger": "^11.2.3",
"@sapphire/snowflake": "^3.5.5",
"@types/passport-jwt": "^4.0.1",
Expand Down Expand Up @@ -76,7 +76,7 @@
"jest": "^30.2.0",
"prettier": "^3.4.2",
"source-map-support": "^0.5.21",
"supertest": "^7.1.4",
"supertest": "^7.2.2",
"ts-jest": "^29.4.0",
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
Expand Down
Loading