Skip to content
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

devops: modify GH actions and Dockerfile #100

Merged
merged 43 commits into from
Sep 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
435aaab
devops: modify GH actions and Dockerfile
alexanderbira Sep 2, 2024
7e54678
devops: use new action to build
alexanderbira Sep 2, 2024
821f654
fix: change Dockerfile path in build file
alexanderbira Sep 2, 2024
b6f4dab
fix: change Dockerfile path in build file
alexanderbira Sep 2, 2024
ab65c38
fix: checkout repo in build file
alexanderbira Sep 2, 2024
03a3a95
devops: use cache for build and push
alexanderbira Sep 2, 2024
22aadfc
wip: doihfo
alexanderbira Sep 2, 2024
5b8cafa
wip: dfskjblsdf
alexanderbira Sep 2, 2024
5c70813
wip: ggggg
alexanderbira Sep 2, 2024
1a28b46
devops: fix tags in workflow
nick-bolas Sep 2, 2024
1bf234e
revert
nick-bolas Sep 2, 2024
f716814
devops: remove cachebust
nick-bolas Sep 2, 2024
989601a
fix: use ivan's thing
alexanderbira Sep 2, 2024
96cf163
fix: apply fixes
alexanderbira Sep 2, 2024
5ab6dbe
fix: apply further fixes
alexanderbira Sep 2, 2024
dde83a5
fix: apply jason fixes 🔨🐧
alexanderbira Sep 2, 2024
aebe9b5
wip: ls the uploads
alexanderbira Sep 2, 2024
af80587
wip: change upload dir to see if the directories are made
alexanderbira Sep 2, 2024
8375a4b
wip: more ls to see where the problem originates
alexanderbira Sep 2, 2024
399705d
wip: tag our thing as latest
alexanderbira Sep 2, 2024
5862948
wip: change upload dir to see if the directories are made
alexanderbira Sep 2, 2024
9bbc8f6
wip: combine CMDs
alexanderbira Sep 3, 2024
9267258
wip: install prisma from dockerfile
alexanderbira Sep 3, 2024
d5c25b3
wip: go back to installing prisma with npm
alexanderbira Sep 3, 2024
dda2e4c
wip: rename uploaded back to uploads
alexanderbira Sep 3, 2024
c5d6b97
wip: install prisma as root
alexanderbira Sep 3, 2024
0b11dd8
wip: set db url before build
alexanderbira Sep 3, 2024
0fbbc80
wip: copy over prisma
alexanderbira Sep 3, 2024
56ada09
devops: install prisma without dev dependencies in Dockerfile
nick-bolas Sep 3, 2024
fd29cda
wip: use another thing to install prisma packages separately
alexanderbira Sep 3, 2024
c3671a7
wip: set db url correctly
alexanderbira Sep 3, 2024
274e3fe
wip: try getting the echo result
alexanderbira Sep 3, 2024
25ee30a
wip: get the correct part of the echo result
alexanderbira Sep 3, 2024
be47c00
wip: retry
alexanderbira Sep 3, 2024
8b30e19
wip: retry
alexanderbira Sep 3, 2024
5602e0a
wip: retry
alexanderbira Sep 3, 2024
f90d28e
feat: create upload dirs
alexanderbira Sep 3, 2024
cd0bf8a
feat: set entra env vars
alexanderbira Sep 3, 2024
e4a9e98
feat: use multiline
alexanderbira Sep 3, 2024
ccc2f7e
feat: use more multiline
alexanderbira Sep 3, 2024
b1da2d6
wip: retry
alexanderbira Sep 3, 2024
e47c0c0
feat: done
alexanderbira Sep 3, 2024
9a2bf0b
chore: capitalise "AS"
alexanderbira Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: apply jason fixes 🔨🐧
alexanderbira committed Sep 2, 2024
commit dde83a5fbf70cb2b248d94f2df320aafed132bc8
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM node:18-alpine AS base

FROM base as app_base

Check warning on line 3 in Dockerfile

GitHub Actions / build-and-push-image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Make UPLOAD_DIRs
ENV UPLOAD_DIR=/uploads
RUN mkdir $UPLOAD_DIR
RUN mkdir $UPLOAD_DIR/banners $UPLOAD_DIR/cvs $UPLOAD_DIR/avatars $UPLOAD_DIR/logos $UPLOAD_DIR/attachments

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
@@ -17,20 +24,15 @@
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1

Check warning on line 27 in Dockerfile

GitHub Actions / build-and-push-image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
RUN npm run build

# Production image, copy all the files and run next
FROM base AS runner
FROM app_base AS runner
WORKDIR /app

# Make UPLOAD_DIRs
ENV UPLOAD_DIR=/uploads
RUN mkdir $UPLOAD_DIR
RUN mkdir $UPLOAD_DIR/banners $UPLOAD_DIR/cvs $UPLOAD_DIR/avatars $UPLOAD_DIR/logos $UPLOAD_DIR/attachments

# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1

Check warning on line 35 in Dockerfile

GitHub Actions / build-and-push-image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

#RUN addgroup --system --gid 1001 nodejs
#RUN adduser --system --uid 1001 nextjs
@@ -56,6 +58,6 @@

ENV PORT=3000

CMD HOSTNAME="0.0.0.0"

Check warning on line 61 in Dockerfile

GitHub Actions / build-and-push-image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 61 in Dockerfile

GitHub Actions / build-and-push-image

Multiple instructions of the same type should not be used in the same stage

MultipleInstructionsDisallowed: Multiple CMD instructions should not be used in the same stage because only the last one will be used More info: https://docs.docker.com/go/dockerfile/rule/multiple-instructions-disallowed/

CMD ["node", "server.js"]