From 57aa7b0dbda03ef320f23f9e254f259ea00ddd5b Mon Sep 17 00:00:00 2001 From: PatrickMohr <61147810+PatrickMohr@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:47:13 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index e047020..a76b1bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,22 @@ -FROM node:lts-alpine +# Dockerfile +FROM node:11.13.0-alpine -# install simple http server for serving static content -RUN npm install -g http-server +# create destination directory +RUN mkdir -p /usr/src/nuxt-app +WORKDIR /usr/src/nuxt-app -# make the 'app' folder the current working directory -WORKDIR /app +# update and install dependency +RUN apk update && apk upgrade +RUN apk add git -# copy both 'package.json' and 'package-lock.json' (if available) -COPY package*.json ./ - -# install project dependencies +# copy the app, note .dockerignore +COPY . /usr/src/nuxt-app/ RUN npm install +RUN npm run build -# copy project files and folders to the current working directory (i.e. 'app' folder) -COPY . . +EXPOSE 3000 -# build app for production with minification -RUN npm run build +ENV NUXT_HOST=0.0.0.0 +ENV NUXT_PORT=3000 -EXPOSE 8080 -CMD [ "http-server", "dist" ] \ No newline at end of file +CMD [ "npm", "start" ]