Added Dockerfile for api, allow bot to be run via npm start
This commit is contained in:
parent
6e8473d784
commit
8393f599b0
3 changed files with 27 additions and 2 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
**/node_modules
|
||||
**/build
|
||||
**/logs
|
||||
**/data
|
18
Dockerfile.api
Normal file
18
Dockerfile.api
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Docker/Kubernetes file for running the image API
|
||||
|
||||
FROM node:alpine
|
||||
|
||||
RUN apk --no-cache upgrade && apk add --no-cache imagemagick imagemagick-dev git msttcorefonts-installer python3 alpine-sdk
|
||||
|
||||
RUN update-ms-fonts && fc-cache -f
|
||||
|
||||
RUN adduser esmBot -s /bin/sh -D
|
||||
WORKDIR /home/esmBot/.internal
|
||||
COPY . .
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
USER esmBot
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["node", "api/index.js"]
|
|
@ -8,9 +8,12 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "node-gyp configure build",
|
||||
"docker:build": "docker build -t headless-chrome-alpine --no-cache ./utils/screenshot",
|
||||
"docker:build-api": "docker build -t esmbot-api --no-cache -f Dockerfile.api .",
|
||||
"docker:build-ss": "docker build -t headless-chrome-alpine --no-cache ./utils/screenshot",
|
||||
"docker:run-api": "docker run --rm --network=host esmbot-api",
|
||||
"docker:run-ss": "docker run --rm --network=host --shm-size=128m headless-chrome-alpine",
|
||||
"docker:run-lava": "docker run --rm --network host -v \"$(pwd)\"/application.yml:/opt/Lavalink/application.yml -v \"$(pwd)\"/assets:/opt/Lavalink/assets fredboat/lavalink:dev"
|
||||
"docker:run-lava": "docker run --rm --network host -v \"$(pwd)\"/application.yml:/opt/Lavalink/application.yml -v \"$(pwd)\"/assets:/opt/Lavalink/assets fredboat/lavalink:dev",
|
||||
"start": "node app.js"
|
||||
},
|
||||
"author": "Essem <essem@essem.space>",
|
||||
"license": "MIT",
|
||||
|
|
Loading…
Reference in a new issue