-
Notifications
You must be signed in to change notification settings - Fork 150
Updated Docker Build & Vulnerability Patching #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
043c6a8
f1b89ed
5c1ebae
fc77afe
6cb3913
d9fa642
ec08d15
04c42ec
8f1fb99
1efe556
14842fe
47d9d86
28206fb
903dbd3
34c6f3b
b63b41c
cf5ada6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ | |
| !yarn.lock | ||
| !docker-entrypoint.sh | ||
| !build.sh | ||
| !start.sh | ||
| !default.conf | ||
| !server/* | ||
| !client/* | ||
| **/node_modules/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,33 @@ | ||
| FROM node:18-bullseye-slim | ||
|
|
||
| USER node:node | ||
| # Stage 1: Build Stage | ||
| FROM node:alpine3.19 AS builder | ||
|
|
||
| WORKDIR /home/node | ||
| COPY --chown=node:node . . | ||
|
|
||
| # Server environmental variables will be put into server/.env | ||
| ENV MAILGUN_API_KEY=api-key \ | ||
| MAILGUN_DOMAIN=darkwire.io \ | ||
| ABUSE_TO_EMAIL_ADDRESS=abuse@darkwire.io \ | ||
| ABUSE_FROM_EMAIL_ADDRESS="Darkwire <no-reply@darkwire.io>" \ | ||
| CLIENT_DIST_DIRECTORY='client/dist/'\ | ||
| ROOM_HASH_SECRET='some-uuid'\ | ||
| SITE_URL=https://darkwire.io \ | ||
| STORE_BACKEND=memory | ||
|
|
||
| # Client configuration will be put into client/.env | ||
| ENV TZ=UTC \ | ||
| VITE_API_HOST=localhost \ | ||
| VITE_API_PROTOCOL=http \ | ||
| VITE_API_PORT=3001 \ | ||
| VITE_COMMIT_SHA=some_sha \ | ||
| VITE_MAX_FILE_SIZE=4 | ||
| RUN apk update \ | ||
| && apk add --no-cache bash \ | ||
| && chmod +x /home/node/start.sh \ | ||
| && npm install -g yarn@latest --force \ | ||
| && yarn install --flat --production --no-cache \ | ||
| && yarn build --no-cache \ | ||
| && rm -rf /home/node/node_modules \ | ||
| && yarn cache clean \ | ||
| && yarn autoclean --force | ||
|
|
||
| COPY --chown=node:node . . | ||
| # Stage 2: Production Stage | ||
| FROM node:alpine3.19 | ||
|
|
||
| RUN yarn && yarn build | ||
| WORKDIR /home/node | ||
| COPY --from=builder /home/node . | ||
|
|
||
| RUN apk add --no-cache curl nginx openssl && \ | ||
| rm /etc/nginx/http.d/default.conf && \ | ||
| mv /home/node/default.conf /etc/nginx/http.d/ && \ | ||
| chmod +x /home/node/start.sh | ||
|
|
||
| STOPSIGNAL SIGINT | ||
| EXPOSE 3001 | ||
|
|
||
| HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \ | ||
| CMD [ "curl", "-f", "${VITE_API_PROTOCOL}://localhost:${VITE_API_PORT}", "||", "exit", "1" ] | ||
| CMD [ "curl", "-f", "http://localhost:3001", "||", "exit", "1" ] | ||
|
|
||
| ENTRYPOINT [ "docker-entrypoint.sh" ] | ||
| CMD ["yarn", "start"] | ||
| CMD ["/home/node/start.sh"] | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,4 @@ | |
| "background_color": "#ffffff", | ||
| "scope": "/", | ||
| "description": "Secure and encrypted web chat with Darkwire.io" | ||
| } | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change is unnecessary ;-)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still haven't gotten around to configure my IDE, spends time time fighting docker engine. |
||
Uh oh!
There was an error while loading. Please reload this page.