From b84047666818f82c898d9834ef9dbef8b7ee8f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Sat, 3 Oct 2020 16:00:47 +0200 Subject: [PATCH] Setup Docker Compose environnement for local dev --- .DS_Store | Bin 0 -> 6148 bytes docker-compose.yml | 18 +++++++++++ .babelrc => nuxt/.babelrc | 0 .editorconfig => nuxt/.editorconfig | 0 .gitignore => nuxt/.gitignore | 0 nuxt/Dockerfile | 2 ++ nuxt/LICENSE | 21 ++++++++++++ nuxt/README.md | 23 +++++++++++++ {assets => nuxt/assets}/README.md | 0 {components => nuxt/components}/Logo.vue | 0 {components => nuxt/components}/README.md | 0 jest.config.js => nuxt/jest.config.js | 0 jsconfig.json => nuxt/jsconfig.json | 0 {layouts => nuxt/layouts}/README.md | 0 {layouts => nuxt/layouts}/default.vue | 0 {middleware => nuxt/middleware}/README.md | 0 nuxt.config.js => nuxt/nuxt.config.js | 34 ++++++++------------ package-lock.json => nuxt/package-lock.json | 0 package.json => nuxt/package.json | 8 +++-- {pages => nuxt/pages}/README.md | 0 {pages => nuxt/pages}/index.vue | 18 +++-------- {plugins => nuxt/plugins}/README.md | 0 {plugins => nuxt/plugins}/antd-ui.js | 0 {static => nuxt/static}/README.md | 0 {static => nuxt/static}/favicon.ico | Bin {store => nuxt/store}/README.md | 0 {test => nuxt/test}/Logo.spec.js | 0 27 files changed, 87 insertions(+), 37 deletions(-) create mode 100644 .DS_Store create mode 100644 docker-compose.yml rename .babelrc => nuxt/.babelrc (100%) rename .editorconfig => nuxt/.editorconfig (100%) rename .gitignore => nuxt/.gitignore (100%) create mode 100644 nuxt/Dockerfile create mode 100644 nuxt/LICENSE create mode 100644 nuxt/README.md rename {assets => nuxt/assets}/README.md (100%) rename {components => nuxt/components}/Logo.vue (100%) rename {components => nuxt/components}/README.md (100%) rename jest.config.js => nuxt/jest.config.js (100%) rename jsconfig.json => nuxt/jsconfig.json (100%) rename {layouts => nuxt/layouts}/README.md (100%) rename {layouts => nuxt/layouts}/default.vue (100%) rename {middleware => nuxt/middleware}/README.md (100%) rename nuxt.config.js => nuxt/nuxt.config.js (62%) rename package-lock.json => nuxt/package-lock.json (100%) rename package.json => nuxt/package.json (62%) rename {pages => nuxt/pages}/README.md (100%) rename {pages => nuxt/pages}/index.vue (79%) rename {plugins => nuxt/plugins}/README.md (100%) rename {plugins => nuxt/plugins}/antd-ui.js (100%) rename {static => nuxt/static}/README.md (100%) rename {static => nuxt/static}/favicon.ico (100%) rename {store => nuxt/store}/README.md (100%) rename {test => nuxt/test}/Logo.spec.js (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4c889e0f4edc24810a0688025fbbaaa03afe6536 GIT binary patch literal 6148 zcmeH~y{ZC1422WjLa^D=avIwUzQG{+1ipZ%AcA0__VehT{2;jAT0~AD`6ihO%bsFq zBOyQ5diE^cEj3d39wiJtjQKc1*XvoMyvW5 zVs&o^OP;IA7L0b$96mIktTx5KG}=WA5|~y80~MeG0|myB_jdoU;s4G5gBGS#fC~JW z0@|%Mt0i74@7A~1v-&oxwr+6Hk0ZSN1R$}icm{XFez65ulP!n}j6VV{0|OQKr~(gE CJ`!~R literal 0 HcmV?d00001 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..580bbd7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + nuxt: + build: ./nuxt + environment: + - HOST=0.0.0.0 + - PORT=3000 + ports: + - "3000:3000" + working_dir: /src + restart: always + command: sh -c "npm install && npm run dev" + volumes: + - ./nuxt:/src:cached + +volumes: + db_data: diff --git a/.babelrc b/nuxt/.babelrc similarity index 100% rename from .babelrc rename to nuxt/.babelrc diff --git a/.editorconfig b/nuxt/.editorconfig similarity index 100% rename from .editorconfig rename to nuxt/.editorconfig diff --git a/.gitignore b/nuxt/.gitignore similarity index 100% rename from .gitignore rename to nuxt/.gitignore diff --git a/nuxt/Dockerfile b/nuxt/Dockerfile new file mode 100644 index 0000000..3693b75 --- /dev/null +++ b/nuxt/Dockerfile @@ -0,0 +1,2 @@ + +FROM node:12.18.4 \ No newline at end of file diff --git a/nuxt/LICENSE b/nuxt/LICENSE new file mode 100644 index 0000000..c133193 --- /dev/null +++ b/nuxt/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 wazolab + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/nuxt/README.md b/nuxt/README.md new file mode 100644 index 0000000..ddedbb7 --- /dev/null +++ b/nuxt/README.md @@ -0,0 +1,23 @@ +# movie-finder + +## Build Setup + +```bash +# install dependencies +$ npm install + +# serve with hot reload at localhost:3000 +$ npm run dev + +# build for production and launch server +$ npm run build +$ npm run start + +# generate static project +$ npm run generate + +# start tests +$ npm run test +``` + +For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). diff --git a/assets/README.md b/nuxt/assets/README.md similarity index 100% rename from assets/README.md rename to nuxt/assets/README.md diff --git a/components/Logo.vue b/nuxt/components/Logo.vue similarity index 100% rename from components/Logo.vue rename to nuxt/components/Logo.vue diff --git a/components/README.md b/nuxt/components/README.md similarity index 100% rename from components/README.md rename to nuxt/components/README.md diff --git a/jest.config.js b/nuxt/jest.config.js similarity index 100% rename from jest.config.js rename to nuxt/jest.config.js diff --git a/jsconfig.json b/nuxt/jsconfig.json similarity index 100% rename from jsconfig.json rename to nuxt/jsconfig.json diff --git a/layouts/README.md b/nuxt/layouts/README.md similarity index 100% rename from layouts/README.md rename to nuxt/layouts/README.md diff --git a/layouts/default.vue b/nuxt/layouts/default.vue similarity index 100% rename from layouts/default.vue rename to nuxt/layouts/default.vue diff --git a/middleware/README.md b/nuxt/middleware/README.md similarity index 100% rename from middleware/README.md rename to nuxt/middleware/README.md diff --git a/nuxt.config.js b/nuxt/nuxt.config.js similarity index 62% rename from nuxt.config.js rename to nuxt/nuxt.config.js index 0da096a..514136a 100644 --- a/nuxt.config.js +++ b/nuxt/nuxt.config.js @@ -4,44 +4,38 @@ export default { // Global page headers (https://go.nuxtjs.dev/config-head) head: { - title: 'movie-finder', + title: "movie-finder", meta: [ - { charset: 'utf-8' }, - { name: 'viewport', content: 'width=device-width, initial-scale=1' }, - { hid: 'description', name: 'description', content: '' } + { charset: "utf-8" }, + { name: "viewport", content: "width=device-width, initial-scale=1" }, + { hid: "description", name: "description", content: "" } ], - link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } - ] + link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }] }, // Global CSS (https://go.nuxtjs.dev/config-css) - css: [ - 'ant-design-vue/dist/antd.css' - ], + css: ["ant-design-vue/dist/antd.css"], // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins) - plugins: [ - '@/plugins/antd-ui' - ], + plugins: ["@/plugins/antd-ui"], // Auto import components (https://go.nuxtjs.dev/config-components) components: true, // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules) - buildModules: [ - ], + buildModules: [], // Modules (https://go.nuxtjs.dev/config-modules) modules: [ // https://go.nuxtjs.dev/axios - '@nuxtjs/axios', + "@nuxtjs/axios" ], // Axios module configuration (https://go.nuxtjs.dev/config-axios) - axios: {}, + axios: { + baseURL: "http://localhost:3000" + }, // Build Configuration (https://go.nuxtjs.dev/config-build) - build: { - } -} + build: {} +}; diff --git a/package-lock.json b/nuxt/package-lock.json similarity index 100% rename from package-lock.json rename to nuxt/package-lock.json diff --git a/package.json b/nuxt/package.json similarity index 62% rename from package.json rename to nuxt/package.json index 74b5510..555369b 100644 --- a/package.json +++ b/nuxt/package.json @@ -1,11 +1,13 @@ { "name": "movie-finder", "version": "1.0.0", + "description": "Nuxt.js test project for LoveToKnow Media job opportunity.", + "author": "NoƩ Viricel ", "private": true, "scripts": { - "dev": "nuxt", - "build": "nuxt build", - "start": "nuxt start", + "dev": "NODE_ENV=development nuxt", + "build": "NODE_ENV=production nuxt build", + "start": "NODE_ENV=production nuxt start", "generate": "nuxt generate", "test": "jest" }, diff --git a/pages/README.md b/nuxt/pages/README.md similarity index 100% rename from pages/README.md rename to nuxt/pages/README.md diff --git a/pages/index.vue b/nuxt/pages/index.vue similarity index 79% rename from pages/index.vue rename to nuxt/pages/index.vue index 1e6d2ef..91e6668 100644 --- a/pages/index.vue +++ b/nuxt/pages/index.vue @@ -2,9 +2,7 @@