mirror of
https://github.com/andwati/order-service.git
synced 2026-11-29 20:38:46 +00:00
remove docker
This commit is contained in:
-18
@@ -1,18 +0,0 @@
|
|||||||
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"]
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
services:
|
|
||||||
mongo:
|
|
||||||
image: mongo:8
|
|
||||||
container_name: order-service-mongo
|
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
volumes:
|
|
||||||
- mongo-data:/data/db
|
|
||||||
entrypoint: >
|
|
||||||
bash -c "
|
|
||||||
mongod --replSet rs0 --bind_ip_all --port 27017 &
|
|
||||||
until mongosh --port 27017 --eval 'db.runCommand({ping:1})' &>/dev/null; do
|
|
||||||
echo 'Waiting for MongoDB...'
|
|
||||||
sleep 2
|
|
||||||
done;
|
|
||||||
echo 'Initializing replica set...';
|
|
||||||
mongosh --port 27017 --eval \"
|
|
||||||
try {
|
|
||||||
rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'localhost:27017'}]});
|
|
||||||
} catch (e) {
|
|
||||||
print('Replica set already initialized');
|
|
||||||
}
|
|
||||||
\";
|
|
||||||
wait"
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mongo-data:
|
|
||||||
@@ -5,6 +5,9 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"start": "node dist/server.js",
|
||||||
|
"dev": "nodemon src/server.ts",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"lint:fix": "eslint . --ext .ts --fix",
|
"lint:fix": "eslint . --ext .ts --fix",
|
||||||
"prettier": "prettier --check .",
|
"prettier": "prettier --check .",
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
import app from "./app.js";
|
|
||||||
import { env } from "./config/env.js";
|
import { env } from "./config/env.js";
|
||||||
import { connectDB } from "./config/db.js";
|
import { connectDB } from "./config/db.js";
|
||||||
|
import app from "./app.js";
|
||||||
|
|
||||||
async function startServer() {
|
async function startServer() {
|
||||||
await connectDB();
|
await connectDB();
|
||||||
|
|||||||
Reference in New Issue
Block a user