-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4e61db
commit 57aa7b0
Showing
1 changed file
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ] | ||
CMD [ "npm", "start" ] |