Container structure is now closer to repository and is now using yarn

main
Štěpán Škorpil 2023-01-05 22:50:14 +01:00
rodzic 5e3e152fa6
commit b8f5d28dd5
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -2,13 +2,13 @@ FROM node:18-bullseye AS prebuild
FROM prebuild AS build
WORKDIR /srv
COPY application/package*.json ./
RUN npm install --frozen-lockfile
RUN yarn install
COPY application/. .
RUN chmod -R uog+r .
RUN npm run build
RUN yarn build
FROM build as dev
CMD npm run dev
CMD yarn dev
FROM prebuild AS prod
RUN groupadd -g 1001 nodejs
@ -19,6 +19,6 @@ WORKDIR /srv
COPY --from=build /srv/node_modules ./node_modules
COPY --from=build /srv/package*.json ./
COPY --from=build /srv/next.config.js ./
COPY --from=build --chown=nextjs:nodejs /srv/src/.next ./.next
COPY --from=build /srv/src/public ./public
CMD node_modules/.bin/next start
COPY --from=build --chown=nextjs:nodejs /srv/src/.next ./src/.next
COPY --from=build /srv/src/public ./src/public
CMD yarn start

Wyświetl plik

@ -10,7 +10,7 @@
"scripts": {
"dev": "next dev ./src --hostname 0.0.0.0",
"build": "next build ./src",
"start": "next start",
"start": "next start ./src",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"generate:graphql-types": "graphql-codegen-esm --config graphql-codegen.yml"
},