fix(docker): fix size of docker image

This commit is contained in:
raiper34
2024-09-30 16:52:30 +02:00
parent 5a51dbd351
commit 310f482cdd
3 changed files with 16 additions and 12 deletions
+14 -10
View File
@@ -1,15 +1,19 @@
FROM node:18 FROM node:18 AS builder
WORKDIR /spooty WORKDIR /spooty
COPY . . COPY . .
RUN npm ci
RUN apt-get -y update && apt-get -y upgrade && apt-get install -y --no-install-recommends ffmpeg
RUN npm install
RUN npm run build RUN npm run build
FROM node:18
WORKDIR /spooty
COPY --from=builder /spooty/dist .
COPY --from=builder /spooty/src ./src
COPY --from=builder /spooty/package.json ./package.json
COPY --from=builder /spooty/package-lock.json ./package-lock.json
COPY --from=builder /spooty/src/backend/.env.default ./.env
RUN rm -rf node_modules
RUN npm ci --omit=dev
RUN apt-get -y update && apt-get -y upgrade && apt-get install -y --no-install-recommends ffmpeg
RUN rm -rf src package.json package-lock.json
EXPOSE 3000 EXPOSE 3000
CMD ["node", "backend/main.js"]
CMD ["npm", "run", "start"]
+1 -1
View File
@@ -14,7 +14,7 @@ The project is based on NestJS and Angular.
# 🚀 Instalation # 🚀 Instalation
Recommended and the easiest way how to start to use of Spooty is using docker. Recommended and the easiest way how to start to use of Spooty is using docker.
```shell ```shell
docker run -d -p 3000:3000 -v /path/to/downloads:/spooty/dist/backend/downloads spooty docker run -d -p 3000:3000 -v /path/to/downloads:/spooty/backend/downloads spooty
``` ```
# 📚 Documentation # 📚 Documentation
+1 -1
View File
@@ -15,7 +15,7 @@
"start": "npm run start:prod -w backend", "start": "npm run start:prod -w backend",
"docs": "docsify serve ./docs", "docs": "docsify serve ./docs",
"deploy:docs": "npm run build:docs && netlify deploy --dir=dist/docs --prod", "deploy:docs": "npm run build:docs && netlify deploy --dir=dist/docs --prod",
"release": "npm run build && docker build -t raiper34/spooty:0.0.0 . && docker push raiper34/spooty:0.0.0" "release": "npm run build && docker build -t raiper34/spooty:1.0.0 -t raiper34/spooty:latest . && docker push raiper34/spooty:1.0.0 && docker push raiper34/spooty:latest"
}, },
"devDependencies": { "devDependencies": {
"copy-files-from-to": "^3.2.2", "copy-files-from-to": "^3.2.2",