├── .gitignore
├── .travis.yml
├── Dockerfile
├── README.md
├── run.sh
├── server
├── .nvmrc
├── package.json
└── server.js
└── test
├── dummy
├── .editorconfig
├── .eslintrc.js
├── .gitignore
├── Dockerfile
├── README.md
├── assets
│ └── README.md
├── components
│ ├── Logo.vue
│ └── README.md
├── layouts
│ ├── README.md
│ └── default.vue
├── middleware
│ └── README.md
├── nuxt.config.js
├── package.json
├── pages
│ ├── README.md
│ └── index.vue
├── plugins
│ └── README.md
├── static
│ ├── README.md
│ └── favicon.ico
└── store
│ └── README.md
└── test.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 |
3 | language: node_js
4 | node_js:
5 | - "10"
6 |
7 | services:
8 | - docker
9 |
10 | install:
11 | - cd test/dummy && yarn && cd - # (the dash means back to previous dir)
12 |
13 | script:
14 | - ./test/test.sh
15 |
16 | after_script:
17 | - docker rm -f docker-nuxt-test
18 | - docker images -q | xargs docker rmi -f
19 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 | LABEL MAINTAINER="briangonzalez"
3 | LABEL version="1.2"
4 |
5 | # Create app directory
6 | RUN mkdir -p /app
7 | COPY . /app
8 |
9 | # Expose the app port
10 | EXPOSE 3000
11 |
12 | ONBUILD ARG autobuild=yes
13 | ONBUILD ENV autobuild ${autobuild}
14 |
15 | # Copy files.
16 | ONBUILD COPY . /app
17 | ONBUILD WORKDIR /app
18 | ONBUILD RUN npm install
19 | ONBUILD RUN if [ "${autobuild}" = "yes" ]; then ./node_modules/.bin/nuxt build; fi
20 |
21 | CMD ["/app/run.sh"]
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [eggplanet/nuxt](https://hub.docker.com/r/eggplanet/nuxt/)
2 |
3 | 
4 |
5 | The lightest nuxt image out there.
6 |
7 | ## Usage
8 |
9 | Add the following to your `Dockerfile` in your nuxt project:
10 |
11 | ```
12 | FROM eggplanet/nuxt
13 | ```
14 |
15 | ## Customize before build
16 |
17 | If you need to customize your project before the nuxt build you can use `--build-arg autobuild=no`. Dont forget to call nuxt build yourself:
18 |
19 | ```
20 | FROM eggplanet/nuxt
21 |
22 | # replace something in nuxt.config.js
23 | RUN sed -i -e 's/apiserver\.dev/apiserver.production/g' nuxt.config.js
24 |
25 | RUN ./node_modules/.bin/nuxt build
26 | ```
27 |
28 | and run `docker build . --build-arg autobuild=no -t your_image_name`
29 |
30 | ## License
31 |
32 | MIT
33 |
--------------------------------------------------------------------------------
/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/ash
2 | node /app/server/server.js
3 |
--------------------------------------------------------------------------------
/server/.nvmrc:
--------------------------------------------------------------------------------
1 | 10
2 |
--------------------------------------------------------------------------------
/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "license": "mit",
4 | "dependencies": {
5 | "nuxt-cluster": "^1.0.0"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/server/server.js:
--------------------------------------------------------------------------------
1 | const server = require('nuxt-cluster');
2 | server.start({
3 | rootDir: '/app/',
4 | address: '0.0.0.0',
5 | port: 3000
6 | });
7 |
--------------------------------------------------------------------------------
/test/dummy/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_size = 2
6 | indent_style = space
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/test/dummy/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | env: {
5 | browser: true,
6 | node: true
7 | },
8 | extends: 'standard',
9 | // required to lint *.vue files
10 | plugins: [
11 | 'html'
12 | ],
13 | // add your custom rules here
14 | rules: {},
15 | globals: {}
16 | }
17 |
--------------------------------------------------------------------------------
/test/dummy/.gitignore:
--------------------------------------------------------------------------------
1 | # dependencies
2 | node_modules
3 |
4 | # logs
5 | npm-debug.log
6 |
7 | # Nuxt build
8 | .nuxt
9 |
10 | # Nuxt generate
11 | dist
12 |
--------------------------------------------------------------------------------
/test/dummy/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM eggplanet/nuxt
2 |
--------------------------------------------------------------------------------
/test/dummy/README.md:
--------------------------------------------------------------------------------
1 | # dummy
2 |
3 | > Nuxt.js project
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | $ npm install # Or yarn install
10 |
11 | # serve with hot reload at localhost:3000
12 | $ npm run dev
13 |
14 | # build for production and launch server
15 | $ npm run build
16 | $ npm start
17 |
18 | # generate static project
19 | $ npm run generate
20 | ```
21 |
22 | For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).
23 |
--------------------------------------------------------------------------------
/test/dummy/assets/README.md:
--------------------------------------------------------------------------------
1 | # ASSETS
2 |
3 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
4 |
5 | More information about the usage of this directory in the documentation:
6 | https://nuxtjs.org/guide/assets#webpacked
7 |
8 | **This directory is not required, you can delete it if you don't want to use it.**
9 |
--------------------------------------------------------------------------------
/test/dummy/components/Logo.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
80 |
--------------------------------------------------------------------------------
/test/dummy/components/README.md:
--------------------------------------------------------------------------------
1 | # COMPONENTS
2 |
3 | The components directory contains your Vue.js Components.
4 | Nuxt.js doesn't supercharge these components.
5 |
6 | **This directory is not required, you can delete it if you don't want to use it.**
7 |
--------------------------------------------------------------------------------
/test/dummy/layouts/README.md:
--------------------------------------------------------------------------------
1 | # LAYOUTS
2 |
3 | This directory contains your Application Layouts.
4 |
5 | More information about the usage of this directory in the documentation:
6 | https://nuxtjs.org/guide/views#layouts
7 |
8 | **This directory is not required, you can delete it if you don't want to use it.**
9 |
--------------------------------------------------------------------------------
/test/dummy/layouts/default.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
53 |
--------------------------------------------------------------------------------
/test/dummy/middleware/README.md:
--------------------------------------------------------------------------------
1 | # MIDDLEWARE
2 |
3 | This directory contains your Application Middleware.
4 | The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts).
5 |
6 | More information about the usage of this directory in the documentation:
7 | https://nuxtjs.org/guide/routing#middleware
8 |
9 | **This directory is not required, you can delete it if you don't want to use it.**
10 |
--------------------------------------------------------------------------------
/test/dummy/nuxt.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | /*
3 | ** Headers of the page
4 | */
5 | head: {
6 | title: 'dummy',
7 | meta: [
8 | { charset: 'utf-8' },
9 | { name: 'viewport', content: 'width=device-width, initial-scale=1' },
10 | { hid: 'description', name: 'description', content: 'Nuxt.js project' }
11 | ],
12 | link: [
13 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
14 | ]
15 | },
16 | /*
17 | ** Customize the progress bar color
18 | */
19 | loading: { color: '#3B8070' },
20 | /*
21 | ** Build configuration
22 | */
23 | build: {
24 | /*
25 | ** Run ESLint on save
26 | */
27 | extend (config, ctx) {
28 | if (ctx.dev && ctx.isClient) {
29 | config.module.rules.push({
30 | enforce: 'pre',
31 | test: /\.(js|vue)$/,
32 | loader: 'eslint-loader',
33 | exclude: /(node_modules)/
34 | })
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/test/dummy/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dummy",
3 | "version": "1.0.0",
4 | "description": "Nuxt.js project",
5 | "author": "Brian Gonzalez ",
6 | "private": true,
7 | "scripts": {
8 | "dev": "nuxt",
9 | "build": "nuxt build",
10 | "start": "nuxt start",
11 | "generate": "nuxt generate",
12 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
13 | "precommit": "npm run lint"
14 | },
15 | "dependencies": {
16 | "lodash": "^4.17.11",
17 | "macaddress": "^0.2.9",
18 | "nuxt": "^2.3.4"
19 | },
20 | "devDependencies": {
21 | "babel-eslint": "^7.2.3",
22 | "eslint": "^4.3.0",
23 | "eslint-config-standard": "^10.2.1",
24 | "eslint-loader": "^1.9.0",
25 | "eslint-plugin-html": "^3.1.1",
26 | "eslint-plugin-import": "^2.7.0",
27 | "eslint-plugin-node": "^5.1.1",
28 | "eslint-plugin-promise": "^3.5.0",
29 | "eslint-plugin-standard": "^3.0.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/test/dummy/pages/README.md:
--------------------------------------------------------------------------------
1 | # PAGES
2 |
3 | This directory contains your Application Views and Routes.
4 | The framework reads all the .vue files inside this directory and create the router of your application.
5 |
6 | More information about the usage of this directory in the documentation:
7 | https://nuxtjs.org/guide/routing
8 |
--------------------------------------------------------------------------------
/test/dummy/pages/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dummy
7 |
8 |
9 | Nuxt.js project
10 |
11 |
15 |
16 |
17 |
18 |
19 |
28 |
29 |
59 |
--------------------------------------------------------------------------------
/test/dummy/plugins/README.md:
--------------------------------------------------------------------------------
1 | # PLUGINS
2 |
3 | This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application.
4 |
5 | More information about the usage of this directory in the documentation:
6 | https://nuxtjs.org/guide/plugins
7 |
8 | **This directory is not required, you can delete it if you don't want to use it.**
9 |
--------------------------------------------------------------------------------
/test/dummy/static/README.md:
--------------------------------------------------------------------------------
1 | # STATIC
2 |
3 | This directory contains your static files.
4 | Each file inside this directory is mapped to /.
5 |
6 | Example: /static/robots.txt is mapped as /robots.txt.
7 |
8 | More information about the usage of this directory in the documentation:
9 | https://nuxtjs.org/guide/assets#static
10 |
11 | **This directory is not required, you can delete it if you don't want to use it.**
12 |
--------------------------------------------------------------------------------
/test/dummy/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eggplanetio/docker-nuxt/029cae67e7cc1c0c15d3e1d6d5d1c2e4187c9f11/test/dummy/static/favicon.ico
--------------------------------------------------------------------------------
/test/dummy/store/README.md:
--------------------------------------------------------------------------------
1 | # STORE
2 |
3 | This directory contains your Vuex Store files.
4 | Vuex Store option is implemented in the Nuxt.js framework.
5 | Creating a index.js file in this directory activate the option in the framework automatically.
6 |
7 | More information about the usage of this directory in the documentation:
8 | https://nuxtjs.org/guide/vuex-store
9 |
10 | **This directory is not required, you can delete it if you don't want to use it.**
11 |
--------------------------------------------------------------------------------
/test/test.sh:
--------------------------------------------------------------------------------
1 |
2 | echo "*****************************"
3 | echo "* RUNNING SMOKE TESTS *"
4 | echo "*****************************"
5 |
6 | docker build -t eggplanet/nuxt . && \
7 | cd test/dummy && \
8 | docker build -t docker-nuxt-test . && \
9 | docker run -d -p 10000:3000 --name docker-nuxt-test docker-nuxt-test
10 |
11 | sleep 10
12 |
13 | string="server-rendered"
14 | if curl -s "http://localhost:10000" | grep -q "$string"; then
15 | echo "Success"
16 | exit 0
17 | else
18 | echo "Error"
19 | exit 1
20 | fi
21 |
--------------------------------------------------------------------------------