-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from fiit-tp7-2023/docker-image-optimization
Optimize docker image
- Loading branch information
Showing
5 changed files
with
458 additions
and
311 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.git | ||
.nuxt | ||
.output | ||
.vscode | ||
.husky | ||
.github | ||
node_modules | ||
|
||
.env.example | ||
.gitignore | ||
README.md | ||
.editorconfig | ||
.eslintrc | ||
reviewpad.yml | ||
.prettierrc | ||
.commitlintrc.js |
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,17 +1,23 @@ | ||
FROM node:20.10.0 | ||
FROM node:20.10.0-slim as base | ||
|
||
RUN apt-get update && apt-get --no-install-recommends install -y ca-certificates fonts-liberation fonts-noto-color-emoji libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils && rm -rf /var/lib/apt/lists/* | ||
RUN mkdir -p /app/ | ||
WORKDIR /app/ | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY --link . . | ||
|
||
RUN npm install -g pnpm | ||
FROM base AS dev | ||
ENV HUSKY=0 | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install && pnpm run build | ||
|
||
RUN mkdir -p /usr/local/team07/presentation-web/frontend | ||
WORKDIR /usr/local/team07/presentation-web/frontend | ||
|
||
COPY . . | ||
|
||
RUN pnpm install | ||
RUN pnpm build | ||
FROM base | ||
ENV HUSKY=0 | ||
RUN apt update && apt install -y --no-install-recommends libglib2.0-0 libnss3 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2 && apt clean | ||
RUN npm pkg delete scripts.prepare | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod | ||
COPY --from=dev /app/.output /app/.output | ||
COPY --from=dev /root/.cache/puppeteer /root/.cache/puppeteer | ||
|
||
EXPOSE 3000 | ||
|
||
CMD [ "node", ".output/server/index.mjs" ] |
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,5 +1,3 @@ | ||
version: '1.0' | ||
|
||
networks: | ||
team07: | ||
external: true | ||
|
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
Oops, something went wrong.