Skip to content

Commit ef7ec15

Browse files
committed
Create Dockerfile
1 parent fcb8093 commit ef7ec15

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

apps/chatbot-server/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use Node.js 20 as the base image
2+
FROM node:20-alpine
3+
4+
# Expects the context `./` to be the root of the monorepo
5+
# and expects the package to be built
6+
7+
COPY ./apps/chatbot-server ./apps/chatbot-server
8+
9+
# Copy the node_modules directory from the root
10+
COPY node_modules ./node_modules
11+
12+
# Install pnpm globally
13+
RUN npm install -g [email protected]
14+
15+
# Set the working directory to the chatbot-server
16+
WORKDIR ./apps/chatbot-server
17+
18+
# Expose port 3030
19+
EXPOSE 3030
20+
21+
# Set environment variable to use port 3030
22+
ENV PORT=3030
23+
24+
# Start the server
25+
CMD ["pnpm", "start"]

apps/chatbot-server/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"build": "lg build-package",
1313
"tsc": "lg build-ts",
1414
"ingest": "pnpm build && ingest all --config ./dist/esm/ingest.config.js",
15-
"dev": "tsx src/index.ts"
15+
"dev": "tsx src/index.ts",
16+
"start": "node dist/esm/index.js",
17+
"docker:build": "pnpm run build && docker build -t chatbot-server --file ./Dockerfile ../..",
18+
"docker:prune": "docker builder prune --filter \"label=app=chatbot-server\" -f",
19+
"docker:start": "docker run -p 3030:3030 chatbot-server"
1620
},
1721
"keywords": [],
1822
"author": "",

0 commit comments

Comments
 (0)