Created
December 14, 2021 08:09
-
-
Save alex-andreiev/ab98cf3cb99d92da05d01a2ce6394f87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM dovkerhub_user/base_images:funfront0.1 AS builder | |
| ENV CDN_ROUTE "$CDN_ROUTE" | |
| ENV NEXT_PUBLIC_API_ROUTE "$NEXT_PUBLIC_API_ROUTE" | |
| ENV BUCKET "$BUCKET" | |
| ENV AWS_ACCESS_KEY_ID "$AWS_ACCESS_KEY_ID" | |
| ENV AWS_SECRET_ACCESS_KEY "$AWS_SECRET_ACCESS_KEY" | |
| RUN npm install -g i18nexus-cli | |
| WORKDIR /app | |
| COPY . . | |
| RUN yarn install | |
| RUN i18nexus pull -k $I18NEXUS_KEY | |
| RUN NEXT_PUBLIC_API_ROUTE=$NEXT_PUBLIC_API_ROUTE CDN_ROUTE=$CDN_ROUTE yarn build | |
| RUN aws s3 sync .next/static s3://$BUCKET/_next/static --cache-control max-age=31536000,public | |
| FROM node:14 AS runner | |
| WORKDIR /app | |
| COPY next.config.js /app/next.config.js | |
| COPY next-i18next.config.js /app/next-i18next.config.js | |
| COPY postcss.config.js /app/postcss.config.js | |
| COPY tailwind.config.js /app/tailwind.config.js | |
| COPY package.json yarn.lock ./ | |
| COPY --from=builder /app/public /app/public | |
| COPY --from=builder /app/.next /app/.next | |
| COPY --from=builder /app/node_modules /app/node_modules | |
| EXPOSE 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment