-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Build own images for different platforms - Generalize Dockerfile - Update yarn, refactor a bit - update actions
- Loading branch information
1 parent
4f8def0
commit 1c7825d
Showing
18 changed files
with
978 additions
and
690 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 was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
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,16 +1,14 @@ | ||
packageExtensions: | ||
"html-to-pdf@*": | ||
dependencies: | ||
# those below are needed for "@sentry/node" but it did not work specifying it for sentry | ||
# so it's configured for main package for now | ||
tslib: "*" | ||
cookie: "*" | ||
debug@*: | ||
dependencies: | ||
supports-color: "*" | ||
html-to-pdf@*: | ||
dependencies: | ||
cookie: "*" | ||
tslib: "*" | ||
ws@*: | ||
dependencies: | ||
bufferutil: "*" | ||
utf-8-validate: "*" | ||
|
||
yarnPath: .yarn/releases/yarn-3.0.0-rc.2.cjs | ||
yarnPath: .yarn/releases/yarn-3.2.4.cjs |
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,77 @@ | ||
FROM node:16-alpine as builder | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN yarn install && yarn build | ||
|
||
|
||
FROM alpine:3.16 as prod | ||
|
||
ARG RELEASE_ID | ||
ARG CI_BUILD_DATE | ||
|
||
ENV \ | ||
CHROME_BIN=/usr/bin/chromium-browser \ | ||
CHROME_PATH=/usr/lib/chromium/ \ | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 \ | ||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \ | ||
RELEASE_ID=$RELEASE_ID \ | ||
CI_BUILD_DATE=$CI_BUILD_DATE | ||
|
||
# Installs latest Chromium package. | ||
RUN \ | ||
apk upgrade --no-cache --available \ | ||
&& apk add --no-cache \ | ||
chromium \ | ||
ttf-freefont \ | ||
font-noto-emoji \ | ||
&& apk add --no-cache \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
font-wqy-zenhei \ | ||
&& apk add --no-cache \ | ||
tini make gcc g++ python3 git nodejs npm yarn \ | ||
&& mkdir -p /app/build \ | ||
&& adduser -D chrome \ | ||
&& chown -R chrome:chrome /app | ||
|
||
WORKDIR /app | ||
|
||
COPY deploy/local.conf /etc/fonts/local.conf | ||
COPY --from=builder /app/build/main.prod.js . | ||
COPY favicon.ico . | ||
COPY deploy/docker-entrypoint.sh /docker-entrypoint.sh | ||
COPY README.md . | ||
|
||
# Run Chrome as non-privileged | ||
USER chrome | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
|
||
EXPOSE 4000 | ||
CMD ["/docker-entrypoint.sh"] | ||
|
||
|
||
FROM prod as dev | ||
|
||
# change user to bypass write limitations | ||
USER root | ||
|
||
COPY . /app | ||
|
||
RUN chown -R chrome ./ | ||
|
||
# change user back to one used by zenika image | ||
USER chrome | ||
|
||
RUN yarn install | ||
|
||
|
||
FROM prod as test | ||
|
||
# change user to bypass write limitations | ||
USER root | ||
|
||
COPY . /app | ||
|
||
RUN yarn |
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
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
File renamed without changes.
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,31 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | ||
<fontconfig> | ||
|
||
<alias> | ||
<family>sans-serif</family> | ||
<prefer> | ||
<family>Main sans-serif font name goes here</family> | ||
<family>Noto Color Emoji</family> | ||
<family>Noto Emoji</family> | ||
</prefer> | ||
</alias> | ||
|
||
<alias> | ||
<family>serif</family> | ||
<prefer> | ||
<family>Main serif font name goes here</family> | ||
<family>Noto Color Emoji</family> | ||
<family>Noto Emoji</family> | ||
</prefer> | ||
</alias> | ||
|
||
<alias> | ||
<family>monospace</family> | ||
<prefer> | ||
<family>Main monospace font name goes here</family> | ||
<family>Noto Color Emoji</family> | ||
<family>Noto Emoji</family> | ||
</prefer> | ||
</alias> | ||
</fontconfig> |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
target "docker-metadata-action" {} | ||
|
||
target "build" { | ||
inherits = ["docker-metadata-action"] | ||
context = "./" | ||
dockerfile = "deploy/prod/Dockerfile" | ||
platforms = [ | ||
"linux/386", | ||
"linux/amd64", | ||
"linux/arm64/v8", | ||
] | ||
} |
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
Oops, something went wrong.