Skip to content

Instantly share code, notes, and snippets.

@igorjacauna
Created January 12, 2021 17:14
Show Gist options
  • Save igorjacauna/fc530452049ec68443917e2260bcde0c to your computer and use it in GitHub Desktop.
Save igorjacauna/fc530452049ec68443917e2260bcde0c to your computer and use it in GitHub Desktop.
NuxtJS Docker infra
# This file is used to build base image for NuxtJS application
# It will be pushed for example to my-registry.com/nuxt:base-1.0.0
FROM node:12.18.2-alpine
ENV APP_PATH /usr/src/front
WORKDIR $APP_PATH
COPY package.json package-lock.json $APP_PATH/
EXPOSE 80
RUN npm ci
# This file is for build image for NuxtJS application that is production
# It will be used with the image builded with Dockerfile.base above
FROM my-registry.com/nuxt:base-1.0.0
ADD . $APP_PATH
RUN npm run build
ENV BASE_URL http://0.0.0.0
ENV PORT 80
CMD npm run start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment