Improve Dockerfiles
This commit is contained in:
+15
-3
@@ -1,3 +1,15 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.next
|
||||
.vscode
|
||||
e2e-screenshots
|
||||
node_modules
|
||||
tests
|
||||
.env*
|
||||
.eslintrc.json
|
||||
.gitattributes
|
||||
.gitignore
|
||||
.gitlab-ci.yml
|
||||
.nvmrc
|
||||
.stylelintrc
|
||||
LICENSE
|
||||
README*
|
||||
stack-compose*
|
||||
+14
-6
@@ -3,15 +3,23 @@ FROM node:14-alpine as builder
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . ./
|
||||
RUN NODE_ENV=development npm run build
|
||||
COPY tsconfig.json next-env.d.ts .babelrc next.config.js ./
|
||||
COPY src src/
|
||||
COPY public public/
|
||||
COPY types types/
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NEXT_PUBLIC_API_URL=https://api.dev.sik.party/api
|
||||
RUN npm run build
|
||||
|
||||
FROM node:14-alpine as server
|
||||
WORKDIR /www
|
||||
COPY package.json package-lock.json next.config.js ./
|
||||
RUN npm ci --only=production
|
||||
COPY --from=builder .next .next
|
||||
COPY --from=builder public public
|
||||
COPY package.json package-lock.json ./
|
||||
COPY --from=builder .next .next
|
||||
COPY --from=builder node_modules node_modules
|
||||
COPY --from=builder public public
|
||||
|
||||
RUN npm prune --production
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["npm", "run", "serve"]
|
||||
|
||||
+13
-5
@@ -3,15 +3,23 @@ FROM node:14-alpine as builder
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . ./
|
||||
COPY tsconfig.json next-env.d.ts .babelrc next.config.js ./
|
||||
COPY src src/
|
||||
COPY public public/
|
||||
COPY types types/
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NEXT_PUBLIC_API_URL=https://api.sika.sik.party/api
|
||||
RUN npm run build
|
||||
|
||||
FROM node:14-alpine as server
|
||||
WORKDIR /www
|
||||
COPY package.json package-lock.json next.config.js ./
|
||||
RUN npm ci --only=production
|
||||
COPY --from=builder .next .next
|
||||
COPY --from=builder public public
|
||||
COPY package.json package-lock.json ./
|
||||
COPY --from=builder .next .next
|
||||
COPY --from=builder node_modules node_modules
|
||||
COPY --from=builder public public
|
||||
|
||||
RUN npm prune --production
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["npm", "run", "serve"]
|
||||
|
||||
Reference in New Issue
Block a user