-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker preset #54
Comments
Relevant comment nuxt/framework#5077 (comment) from @sarim, we might use or embed tini as init process to avoid using |
hey @pi0, in this case, i don't see it as being very useful technically this means you'll have to setup a CI action to build the application and then another CI action to build the Dockerfile in my experience things already work as is and currently i don't see a benefit of having a Docker preset one argument was that people use different package managers doesn't need to be more complicated that that! |
I have been using this as my dockerfile for deploying Nuxt apps: ARG NODE_VERSION=20
FROM node:${NODE_VERSION} as build
WORKDIR /app
# Install dependencies
RUN corepack enable
COPY --link package.json pnpm-lock.yaml ./
RUN pnpm i --frozen-lockfile
# Copy source files
COPY --link . .
# Build application
ENV NITRO_PRESET=node-server
RUN pnpm run build
# https://github.com/GoogleContainerTools/distroless/blob/main/nodejs/README.md
FROM gcr.io/distroless/nodejs${NODE_VERSION} as runtime
WORKDIR /app
ARG PORT=3000
ENV NITRO_HOST=0.0.0.0
ENV NITRO_PORT=${PORT}
EXPOSE ${PORT}
COPY --from=build /app /app
CMD [ ".output/server/index.mjs" ] Which can be built with a command like this: |
Built with node and a minimal generated docker image:
Dockerfile
docker
client CLI (alternative would be a JS client but is too much hassle)Note: It might improve heroku preset as well (#49)
The text was updated successfully, but these errors were encountered: