feat: switch to sidebase/nuxt !

This commit is contained in:
valere
2023-03-09 19:40:02 +01:00
parent 63b895633b
commit bab74dd088
86 changed files with 18165 additions and 5562 deletions

View File

@@ -1,13 +1,39 @@
FROM node:18-alpine as develop-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# see https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG NODE_VERSION=node:16.14.2
FROM develop-stage as build-stage
FROM $NODE_VERSION AS dependency-base
# create destination directory
RUN mkdir -p /app
WORKDIR /app
# copy the app, note .dockerignore
COPY package.json .
COPY package-lock.json .
RUN npm ci
FROM dependency-base AS production-base
# build will also take care of building
# if necessary
COPY . .
RUN npm run build
FROM nginx:1.15.7-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
FROM $NODE_VERSION AS production
COPY --from=production-base /app/.output /app/.output
# Service hostname
ENV NUXT_HOST=0.0.0.0
# Service version
ARG NUXT_APP_VERSION
ENV NUXT_APP_VERSION=${NUXT_APP_VERSION}
ENV DATABASE_URL=file:./db.sqlite
# Run in production mode
ENV NODE_ENV=production
# start the app
CMD [ "node", "/app/.output/server/index.mjs" ]