Last active
October 11, 2024 06:35
-
-
Save Semdevmaster/deefff3b6fb0566d559c72d22fd27208 to your computer and use it in GitHub Desktop.
Docker file build nuxt application
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
node_modules | |
.output | |
.nuxt | |
.git | |
.gitignore | |
*.md | |
.dockerignore |
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 node:lts-alpine3.20 AS build | |
ENV PNPM_HOME="/pnpm" | |
ENV PATH="$PNPM_HOME:$PATH" | |
RUN corepack enable && corepack prepare pnpm@latest-9 --activate | |
COPY --chown=node:node . /var/www | |
WORKDIR /var/www | |
RUN pnpm install --frozen-lockfile && pnpm run build | |
FROM node:lts-alpine3.20 | |
ARG TZ=Europe/Moscow | |
RUN apk add --no-cache alpine-conf && setup-timezone -z ${TZ} && apk del alpine-conf | |
COPY --from=build --chown=node:node /var/www/.output /var/www/.output | |
WORKDIR /var/www | |
USER node | |
EXPOSE 3000 | |
CMD ["node", ".output/server/index.mjs"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment