Skip to content

Commit

Permalink
fix: reduced docker image size
Browse files Browse the repository at this point in the history
by not including build tools & node_modules
  • Loading branch information
MauriceNino committed Jun 9, 2022
1 parent e00e597 commit d29ed54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ WORKDIR /app

RUN \
apk update &&\
apk add \
git \
make \
clang \
build-base \
apk --no-cache add \
lsblk \
dmidecode \
util-linux \
lm-sensors \
speedtest-cli &&\
apk add -f \
raspberrypi &&\
git config --global --add safe.directory /app
apk --no-cache add \
raspberrypi \
|| true

# DEV #
FROM base AS dev
Expand All @@ -28,6 +24,14 @@ EXPOSE 3000
# BUILD #
FROM base as build

RUN \
apk --no-cache add \
git \
make \
clang \
build-base &&\
git config --global --add safe.directory /app

COPY . ./

RUN \
Expand All @@ -39,7 +43,6 @@ FROM base as prod

COPY --from=build /app/package.json .
COPY --from=build /app/.yarn/releases/ .yarn/releases/
COPY --from=build /app/node_modules/ node_modules/
COPY --from=build /app/dist/ dist/

EXPOSE 3001
Expand Down
2 changes: 1 addition & 1 deletion apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"configurations": {
"production": {
"externalDependencies": "none",
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
Expand Down
1 change: 0 additions & 1 deletion apps/view/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
Expand Down

0 comments on commit d29ed54

Please sign in to comment.