mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
build(docker): Optimize Docker image layers/caching & bump node to 14.15 (#776)
* refactor(docker): Combine RUN statements to reduce number of image layers * Add --update && --no-cache to apk add command * Combine RUN statements in first stage * Consolidate COPY commands from BUILD_IMAGE * Add docs & snap to .dockerignore * Revert first COPY statement in 2nd stage * Write committag.json in first stage & only do one COPY Also pin base image Alpine version, and add Docker & GitHub Actions update monitoring via Dependabot * Bump node to 14.15.4 * Change base image to node:14.15-alpine and remove Dependabot Docker monitoring * Changes in response to PR comments * Remove ARG/ENV statements from second build stage
This commit is contained in:
@@ -1,15 +1,23 @@
|
|||||||
node_modules
|
**/*.md
|
||||||
.next
|
**/.gitkeep
|
||||||
|
**/.vscode
|
||||||
|
.all-contributorsrc
|
||||||
|
.dockerignore
|
||||||
|
.editorconfig
|
||||||
|
.eslintrc.js
|
||||||
.git
|
.git
|
||||||
|
.gitbook.yaml
|
||||||
.gitconfig
|
.gitconfig
|
||||||
.gitignore
|
.gitignore
|
||||||
.github
|
.github
|
||||||
.all-contributorsrc
|
.next
|
||||||
.editorconfig
|
|
||||||
.prettierignore
|
.prettierignore
|
||||||
**/README.md
|
|
||||||
**/.vscode
|
|
||||||
config/db/db.sqlite3
|
config/db/db.sqlite3
|
||||||
config/db/logs/overseerr.log
|
config/db/logs/overseerr.log
|
||||||
Dockerfil**
|
Dockerfile*
|
||||||
**.md
|
docker-compose.yml
|
||||||
|
docs
|
||||||
|
LICENSE
|
||||||
|
node_modules
|
||||||
|
snap
|
||||||
|
stylelint.config.js
|
||||||
|
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -6,3 +6,9 @@ updates:
|
|||||||
interval: daily
|
interval: daily
|
||||||
time: '20:00'
|
time: '20:00'
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: '20:00'
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
28
Dockerfile
28
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM node:12.18-alpine AS BUILD_IMAGE
|
FROM node:14.15-alpine AS BUILD_IMAGE
|
||||||
|
|
||||||
ARG COMMIT_TAG
|
ARG COMMIT_TAG
|
||||||
ENV COMMIT_TAG=${COMMIT_TAG}
|
ENV COMMIT_TAG=${COMMIT_TAG}
|
||||||
@@ -11,25 +11,21 @@ RUN yarn --frozen-lockfile && \
|
|||||||
|
|
||||||
# remove development dependencies
|
# remove development dependencies
|
||||||
RUN yarn install --production --ignore-scripts --prefer-offline
|
RUN yarn install --production --ignore-scripts --prefer-offline
|
||||||
RUN yarn cache clean
|
|
||||||
|
|
||||||
FROM node:12.18-alpine
|
RUN rm -rf src && \
|
||||||
|
rm -rf server
|
||||||
ARG COMMIT_TAG
|
|
||||||
ENV COMMIT_TAG=${COMMIT_TAG}
|
|
||||||
|
|
||||||
RUN apk add tzdata
|
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# copy from build image
|
|
||||||
COPY --from=BUILD_IMAGE /app/dist ./dist
|
|
||||||
COPY --from=BUILD_IMAGE /app/.next ./.next
|
|
||||||
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
|
|
||||||
|
|
||||||
RUN echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json
|
RUN echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json
|
||||||
|
|
||||||
|
|
||||||
|
FROM node:14.15-alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
|
# copy from build image
|
||||||
|
COPY --from=BUILD_IMAGE /app /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
CMD yarn start
|
CMD yarn start
|
||||||
|
|
||||||
EXPOSE 5055
|
EXPOSE 5055
|
||||||
|
Reference in New Issue
Block a user