-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise and revamp microservice Docker builds to leverage cache, min…
…imise disk size etc.
- Loading branch information
Showing
51 changed files
with
907 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:18-slim | ||
|
||
RUN apt-get update && apt-get upgrade -y | ||
|
||
RUN apt-get clean && \ | ||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* | ||
|
||
USER node | ||
|
||
WORKDIR /app | ||
|
||
COPY --chown=node:node *.json . | ||
COPY --chown=node:node yarn.lock . | ||
|
||
RUN yarn install --production --frozen-lockfile |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,17 @@ | ||
FROM node:hydrogen-alpine | ||
ARG VERSION=dev | ||
FROM opencrvs/ocrvs-base:${VERSION} | ||
|
||
WORKDIR /app | ||
|
||
RUN apk update && apk upgrade | ||
|
||
COPY . . | ||
|
||
RUN rm -rf /app/packages/* | ||
|
||
COPY packages/auth /app/packages/auth | ||
COPY packages/commons /app/packages/commons | ||
|
||
RUN yarn install | ||
USER node | ||
|
||
WORKDIR /app/packages/commons | ||
RUN yarn build | ||
COPY --chown=node:node packages/commons /app/packages/commons | ||
RUN yarn install --frozen-lockfile --ignore-scripts && yarn build | ||
|
||
|
||
WORKDIR /app/packages/auth | ||
COPY --chown=node:node packages/auth/*.json /app/packages/auth/ | ||
RUN yarn install --frozen-lockfile | ||
COPY --chown=node:node packages/auth /app/packages/auth | ||
RUN yarn build | ||
|
||
# FIXME: to be replaced later with whole build running as node | ||
RUN chown -R node:node /app | ||
|
||
USER node | ||
|
||
CMD yarn start:prod | ||
CMD ["yarn", "start:prod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*.md | ||
*.yml | ||
*.yaml | ||
.vscode | ||
**/.git | ||
**/test | ||
**/build | ||
|
||
# From root | ||
**/node_modules | ||
**/coverage | ||
**/.DS_Store | ||
**/.env | ||
**/*.log | ||
.secrets/* | ||
data | ||
grafana | ||
|
||
# Exclude unused packages | ||
packages/* | ||
!packages/commons | ||
!packages/auth |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.