feat: add Dockerfile and docker-compose configuration for application setup

This commit is contained in:
2026-01-12 22:41:44 +03:00
parent 5b85cee125
commit 9e65d2f2d5
3 changed files with 50 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM node:24-alpine
RUN corepack enable && \
corepack prepare pnpm@latest --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
EXPOSE 3000
CMD ["node", "dist/server.js"]
+25
View File
@@ -0,0 +1,25 @@
services:
api:
container_name: order-service-api
build: .
ports:
- "3000:3000"
env_file:
- .env
depends_on:
- mongo
restart: unless-stopped
mongo:
image: mongo:8
container_name: order-service-mongo
command: ["--replSet" , "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
- ./docker/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
restart: unless-stopped
volumes:
mongo-data:
+7 -1
View File
@@ -5,7 +5,13 @@
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "node dist/server.js",
"dev": "ts-node-dev --respawn --transpile-only src/server.ts",
"build": "tsc",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write ."
},
"keywords": [],
"author": "",