fix(docker): fix size of docker image
This commit is contained in:
+14
-10
@@ -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"]
|
|
||||||
@@ -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
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user