diff --git a/examples/docker-build/.dockerignore b/examples/docker-build/.dockerignore new file mode 100644 index 0000000000..f935a370cd --- /dev/null +++ b/examples/docker-build/.dockerignore @@ -0,0 +1,84 @@ +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# Nuxt generate +dist + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# IDE +.idea + +# Service worker +sw.* diff --git a/examples/docker-build/.yarnclean b/examples/docker-build/.yarnclean new file mode 100644 index 0000000000..846be8d4e3 --- /dev/null +++ b/examples/docker-build/.yarnclean @@ -0,0 +1,5 @@ +*.yaml +*.md +*.lock +LICENSE +CHANGELOG diff --git a/examples/docker-build/README.md b/examples/docker-build/README.md new file mode 100644 index 0000000000..a308718006 --- /dev/null +++ b/examples/docker-build/README.md @@ -0,0 +1,12 @@ +# docker-build + +## Build Setup + +```bash +# Build a nuxt-docker image +$ docker build -t nuxt-docker . + +# Run the container for the nuxt-docker image with a exposed port 3000 +$ docker run --rm -it -p 3000:3000 nuxt-docker + +``` diff --git a/examples/docker-build/assets/README.md b/examples/docker-build/assets/README.md new file mode 100644 index 0000000000..56f8545898 --- /dev/null +++ b/examples/docker-build/assets/README.md @@ -0,0 +1 @@ +# ASSETS diff --git a/examples/docker-build/components/README.md b/examples/docker-build/components/README.md new file mode 100644 index 0000000000..6bd97512d8 --- /dev/null +++ b/examples/docker-build/components/README.md @@ -0,0 +1 @@ +# COMPONENTS diff --git a/examples/docker-build/dockerfile b/examples/docker-build/dockerfile new file mode 100644 index 0000000000..205325fba8 --- /dev/null +++ b/examples/docker-build/dockerfile @@ -0,0 +1,31 @@ +FROM node:latest as builder + +WORKDIR /src + +COPY . . + +RUN yarn install \ + --prefer-offline \ + --frozen-lockfile \ + --non-interactive \ + --production=false + +RUN yarn build + +RUN rm -rf node_modules && \ + NODE_ENV=production yarn install \ + --prefer-offline \ + --pure-lockfile \ + --non-interactive \ + --production=true + +FROM node:alpine + +WORKDIR /src + +COPY --from=builder /src . + +ENV HOST 0.0.0.0 +EXPOSE 3000 + +CMD [ "yarn", "start" ] diff --git a/examples/docker-build/layouts/README.md b/examples/docker-build/layouts/README.md new file mode 100644 index 0000000000..dc04186c20 --- /dev/null +++ b/examples/docker-build/layouts/README.md @@ -0,0 +1 @@ +# LAYOUTS diff --git a/examples/docker-build/layouts/default.vue b/examples/docker-build/layouts/default.vue new file mode 100644 index 0000000000..ed56933139 --- /dev/null +++ b/examples/docker-build/layouts/default.vue @@ -0,0 +1,8 @@ + + + diff --git a/examples/docker-build/middleware/README.md b/examples/docker-build/middleware/README.md new file mode 100644 index 0000000000..a98e708949 --- /dev/null +++ b/examples/docker-build/middleware/README.md @@ -0,0 +1 @@ +# MIDDLEWARE diff --git a/examples/docker-build/nuxt.config.js b/examples/docker-build/nuxt.config.js new file mode 100644 index 0000000000..5a8841e423 --- /dev/null +++ b/examples/docker-build/nuxt.config.js @@ -0,0 +1,54 @@ +import pkg from './package' + +export default { + mode: 'universal', + + /* + ** Headers of the page + */ + head: { + title: pkg.name, + meta: [ + { charset: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { hid: 'description', name: 'description', content: pkg.description } + ], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } + ] + }, + + /* + ** Customize the progress-bar color + */ + loading: { color: '#fff' }, + + /* + ** Global CSS + */ + css: [ + ], + + /* + ** Plugins to load before mounting the App + */ + plugins: [ + ], + + /* + ** Nuxt.js modules + */ + modules: [ + ], + + /* + ** Build configuration + */ + build: { + /* + ** You can extend webpack config here + */ + extend(config, ctx) { + } + } +} diff --git a/examples/docker-build/package.json b/examples/docker-build/package.json new file mode 100644 index 0000000000..ec1ae39f7e --- /dev/null +++ b/examples/docker-build/package.json @@ -0,0 +1,16 @@ +{ + "name": "docker-build", + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt-start", + "generate": "nuxt generate" + }, + "dependencies": { + "cross-env": "latest", + "nuxt-start": "latest" + }, + "devDependencies": { + "nuxt": "latest" + } +} diff --git a/examples/docker-build/pages/README.md b/examples/docker-build/pages/README.md new file mode 100644 index 0000000000..2a7198f3d0 --- /dev/null +++ b/examples/docker-build/pages/README.md @@ -0,0 +1 @@ +# PAGES diff --git a/examples/docker-build/pages/index.vue b/examples/docker-build/pages/index.vue new file mode 100644 index 0000000000..050f573569 --- /dev/null +++ b/examples/docker-build/pages/index.vue @@ -0,0 +1,12 @@ + + + + + diff --git a/examples/docker-build/plugins/README.md b/examples/docker-build/plugins/README.md new file mode 100644 index 0000000000..49df5d2ddb --- /dev/null +++ b/examples/docker-build/plugins/README.md @@ -0,0 +1 @@ +# PLUGINS diff --git a/examples/docker-build/static/README.md b/examples/docker-build/static/README.md new file mode 100644 index 0000000000..8fce910597 --- /dev/null +++ b/examples/docker-build/static/README.md @@ -0,0 +1 @@ +# STATIC diff --git a/examples/docker-build/static/favicon.ico b/examples/docker-build/static/favicon.ico new file mode 100644 index 0000000000..382fecbbf9 Binary files /dev/null and b/examples/docker-build/static/favicon.ico differ diff --git a/examples/docker-build/store/README.md b/examples/docker-build/store/README.md new file mode 100644 index 0000000000..0987715ce3 --- /dev/null +++ b/examples/docker-build/store/README.md @@ -0,0 +1 @@ +# STORE