Last active
December 22, 2019 08:16
-
-
Save daliborgogic/b6d9d487420ed1c2ad8b427965a50081 to your computer and use it in GitHub Desktop.
Mnml Nuxt.js Docker ~57.5MB
This file contains hidden or 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
* | |
!assets | |
!pages | |
!static | |
!nuxt.config.js | |
!package*.json |
This file contains hidden or 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
FROM mhart/alpine-node:10.10.0 | |
WORKDIR /app | |
COPY . . | |
RUN npm ci | |
RUN npm run build | |
# Magic! | |
RUN npm ci nuxt-start-edge debug --production | |
FROM mhart/alpine-node:base-10.10.0 | |
WORKDIR /app | |
ENV NODE_ENV production | |
ENV HOST 0.0.0.0 | |
ENV PORT 3000 | |
COPY package.json . | |
COPY nuxt.config.js . | |
COPY --from=0 ./app/node_modules ./node_modules | |
COPY --from=0 ./app/.nuxt ./.nuxt | |
COPY --from=0 ./app/static ./static | |
EXPOSE 3000 | |
CMD ["node_modules/nuxt-start-edge/bin/nuxt-start"] |
This file contains hidden or 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
{ | |
"name": "mnml", | |
"version": "1.0.0", | |
"description": "Mnml Nuxt.js Docker", | |
"scripts": { | |
"dev": "node_modules/.bin/nuxt", | |
"build": "node_modules/.bin/nuxt build", | |
"start": "node_modules/nuxt-start-edge/bin/nuxt-start" | |
}, | |
"dependencies": { | |
"debug": "^4.0.1", | |
"nuxt-start-edge": "^2.0.0-25615151.226b90d" | |
}, | |
"devDependencies": { | |
"nuxt-edge": "^2.0.0-25615151.226b90d", | |
} | |
} |
REPOSITORY TAG IMAGE ID CREATED SIZE
mnml latest 9c3a50fb7ab5 3 minutes ago 54.6MB
Dockerfile
ARG VERSION=12.9.1
FROM mhart/alpine-node:${VERSION} AS dev
WORKDIR /app
COPY package*.json .gitignore ./
ENV HOST=0.0.0.0
RUN npm ci --prefer-offline --no-audit
COPY . ./app/
EXPOSE 3000
CMD ["node_modules/.bin/nuxt"]
FROM dev AS test
RUN npm run lint && npm test
FROM test AS build
RUN npm run build \
&& npm ci --prefer-offline --no-audit --prod \
&& cp -R node_modules prod_node_modules
FROM mhart/alpine-node:slim-${VERSION} AS release
ENV HOST=0.0.0.0
COPY --from=build /app/prod_node_modules ./node_modules
COPY --from=build /app/.nuxt ./.nuxt
EXPOSE 3000
CMD ["node_modules/.bin/nuxt-start"]
package.json
{
"name": "mnml",
"version": "0.1.0",
"scripts": {
"dev": "nuxt",
"build": "nuxt build --modern",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lintfix": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
"test": "echo \"WARN: no test specified 😁\" && exit 0",
"start": "nuxt-start"
},
"dependencies": {
"nuxt-start": "^2.9.2"
},
"devDependencies": {
"nuxt": "^2.9.2",
"postcss-nested": "^4.1.2",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^5.2.2"
},
"eslintConfig": {
"root": true,
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"parser": "babel-eslint"
},
"extends": [
"eslint:recommended",
"plugin:vue/recommended"
],
"plugins": [
"vue"
],
"rules": {
"semi": [
2,
"never"
],
"no-console": "error",
"vue/max-attributes-per-line": "off"
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.