added docker files & build script

This commit is contained in:
SrGooglo 2023-05-30 01:20:12 +00:00
parent 2740aab7d9
commit 8a88217965
3 changed files with 35 additions and 1 deletions

View File

@ -29,6 +29,13 @@ services:
- "5002:3040" - "5002:3040"
env_file: env_file:
- marketplace.env - marketplace.env
music_server:
build: packages/music_server
restart: unless-stopped
ports:
- "5003:3050"
env_file:
- music.env
redis: redis:
image: redis/redis-stack-server:latest image: redis/redis-stack-server:latest
restart: unless-stopped restart: unless-stopped

View File

@ -0,0 +1,26 @@
FROM node:16-bullseye-slim
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update
RUN apt install --no-install-recommends curl ffmpeg python yarn build-essential -y
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
USER node
EXPOSE 3050
COPY package.json ./
COPY --chown=node:node . .
RUN chmod -R 777 /home/node/app
RUN export NODE_ENV=production
RUN yarn global add cross-env
RUN yarn install --production
RUN yarn build
CMD ["yarn", "run", "run:prod"]

View File

@ -4,7 +4,8 @@
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"build": "corenode-cli build", "build": "corenode-cli build",
"dev": "nodemon --ignore dist/ --exec corenode-node ./src/index.js" "dev": "nodemon --ignore dist/ --exec corenode-node ./src/index.js",
"run:prod": "cross-env NODE_ENV=production node ./dist/index.js"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {