Add dockerfile and compose file for build
This commit is contained in:
parent
f48c36f9c3
commit
6edd6ec2cc
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM node:18-slim as ts-compiler
|
||||
WORKDIR /usr/app
|
||||
COPY yarn.lock ./
|
||||
COPY package*.json ./
|
||||
COPY tsconfig*.json ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
COPY . ./
|
||||
RUN yarn run build
|
||||
|
||||
FROM node:18-slim as ts-remover
|
||||
WORKDIR /usr/app
|
||||
COPY --from=ts-compiler /usr/app/yarn.lock ./
|
||||
COPY --from=ts-compiler /usr/app/package*.json ./
|
||||
COPY --from=ts-compiler /usr/app/dist ./
|
||||
ENV NODE_ENV=production
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
FROM node:18-slim
|
||||
WORKDIR /usr/app
|
||||
COPY --from=ts-remover /usr/app ./
|
||||
CMD node index.js
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
||||
version: '3'
|
||||
services:
|
||||
openai-discord:
|
||||
build: .
|
||||
container_name: openai-discord
|
||||
working_dir: /usr/app
|
||||
environment:
|
||||
- DISCORD_API_KEY
|
||||
- OPENAI_API_KEY
|
||||
restart: unless-stopped
|
@ -19,7 +19,6 @@
|
||||
"@types/node": "^18.15.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||
"@typescript-eslint/parser": "^5.51.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.33.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-airbnb-typescript": "^17.0.0",
|
||||
@ -31,6 +30,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"discord.js": "^14.7.1",
|
||||
"dotenv": "^16.0.3",
|
||||
"openai": "^3.2.1",
|
||||
"winston": "^3.8.2"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user