add files for docker deploy#1
Conversation
| @@ -0,0 +1,30 @@ | |||
| FROM node:20-alpine AS deps | |||
There was a problem hiding this comment.
Pls koristi zadnji LTS (node 22). Node 20 ide u maintainance mode za koji tjedan.
Preporučam napraviti nešto kao:
FROM node:22-alpine AS base
FROM base AS deps
...| RUN yarn --frozen-lockfile | ||
|
|
||
| FROM node:20-alpine AS builder | ||
| ARG APP_FILE_STORAGE_DIR |
There was a problem hiding this comment.
Ovi argovi su nepotrebni, pls ih makni
| WORKDIR /app | ||
| COPY --from=deps /app/node_modules ./node_modules | ||
| COPY . . | ||
|
|
There was a problem hiding this comment.
Preporučam da dodaš
ENV NEXT_TELEMETRY_DISABLED 1
ENV SKIP_ENV_VALIDATION 1
da ne šaljemo telemetriju pri CI buildovima baš
|
|
||
| RUN SKIP_ENV_VALIDATION=1 yarn build | ||
|
|
||
| FROM gcr.io/distroless/nodejs20-debian12 AS runner |
There was a problem hiding this comment.
Zašto koristiš drugačiju verziju nodejs za build i release?
Pls standardiziraj na gore naveden base koji dodaš
|
|
||
| ENV NODE_ENV production | ||
|
|
||
| COPY --from=builder /app/next.config.mjs ./ |
There was a problem hiding this comment.
Jedino što je potrebno kopirati su public, .next/standalone i .next/static, pls makni ostale
| args: | ||
| APP_FILE_STORAGE_DIR: ${APP_FILE_STORAGE_DIR} | ||
| APP_PUBLIC_URL: ${APP_PUBLIC_URL} | ||
| working_dir: /app |
There was a problem hiding this comment.
Također nepotrebno, može potrgati stvar ako se promijeni dockerfile
| APP_FILE_STORAGE_DIR: ${APP_FILE_STORAGE_DIR} | ||
| APP_PUBLIC_URL: ${APP_PUBLIC_URL} | ||
| working_dir: /app | ||
| ports: |
There was a problem hiding this comment.
Ports ne treaba biti u compose file-u. To se dodaje u override (jer npr. za naše potrebe ne želimo exposati niti jedan port)
| working_dir: /app | ||
| ports: | ||
| - "3000:3000" | ||
| image: comp_ctf_2023 |
There was a problem hiding this comment.
Ovo isto nije dobro da je tu, pls makni
There was a problem hiding this comment.
Što je ova datoteka i zašto je tu?
There was a problem hiding this comment.
Dodaj još .env.example, yarn-error.log, .vscode i compose.* da maknemo još te nepotrebne stvari
please review and say what I did wrong