diff --git a/backend/Dockerfile b/backend/Dockerfile index 728518f..9f5120b 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:latest +FROM node:latest as devStage # some dir for our code WORKDIR /app @@ -9,8 +9,5 @@ EXPOSE 3000 COPY package*.json . RUN yarn -# copy code -COPY . . - # this is how we start -CMD ["yarn", "start"] +CMD ["yarn", "watch"] diff --git a/backend/inc/fftcgrouter.coffee b/backend/inc/fftcgrouter.coffee index 9b6259c..c567dc3 100644 --- a/backend/inc/fftcgrouter.coffee +++ b/backend/inc/fftcgrouter.coffee @@ -10,7 +10,7 @@ fftcgdb = new FFTCGDB path.resolve(__dirname, '../fftcg.db') # create router FFTCGROUTER = express.Router() -FFTCGROUTER.use express.static path.resolve(__dirname, '../public_html') +# FFTCGROUTER.use express.static path.resolve(__dirname, '../public_html') # register user FFTCGROUTER.post '/register', (req, res) -> diff --git a/backend/package.json b/backend/package.json index dbe5b63..f4fb044 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { - "name": "node-fftcg", - "version": "0.0.3", + "name": "yvk-fftcg-backend", + "version": "0.1.0", "description": "FFTCG online using Socket.IO and CraftyJS on Node.js on Docker", "author": "JMM ", @@ -10,36 +10,11 @@ "license": "UNLICENSED", "scripts": { - "build": "webpack", - "watch": "webpack --watch", - "start": "webpack && coffee server.coffee", - "debug": "webpack --watch & nodemon server.coffee", + "start": "coffee server.coffee", + "watch": "nodemon server.coffee", "test": "echo \"Error: no test specified\" && exit 1" }, - "devDependencies": { - "@babel/core": "^7.1.6", - "@babel/preset-env": "^7.1.6", - "coffee-loader": "^0.9.0", - - "autoprefixer": "^9.3.1", - "css-loader": "^1.0.1", - "postcss-loader": "^3.0.0", - "node-sass": "^4.10.0", - "precss": "^3.1.2", - "sass-loader": "^7.1.0", - "style-loader": "^0.23.1", - - "nodemon": "^1.18.9", - "webpack": "^4.25.1", - "webpack-cli": "^3.1.2", - - "bootstrap": "^4.1.3", - "craftyjs": "^0.9.0", - "jquery": "^3.3.1", - "popper.js": "^1.14.5" - }, - "dependencies": { "bcrypt": "^3.0.2", "body-parser": "^1.18.3", @@ -49,9 +24,11 @@ "express-session": "^1.15.6", "express-socket.io-session": "^1.3.5", "helmet": "^3.15.0", - "pug": "^2.0.3", "socket.io": "^2.2.0", - "socket.io-client": "^2.2.0", "sqlite3": "^4.0.4" + }, + + "devDependencies": { + "nodemon": "^1.18.9" } } diff --git a/docker-compose.yml b/docker-compose.yml index d77837d..b9bd00e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,18 @@ version: "2" services: - fftcg: - build: . - command: "yarn debug" - restart: "no" - volumes: - - "${PWD}/src:/app/src" - - "${PWD}/views:/app/views:ro" - - "${PWD}/public_html:/app/public_html" - - "${PWD}/inc:/app/inc:ro" - - "${PWD}/server.coffee:/app/server.coffee:ro" - # - "${PWD}/fftcg.db:/app/fftcg.db" - ports: - - "3000:3000" - redis: image: redis:alpine restart: "no" + + backend: + build: + context: ./backend + target: devStage + restart: "no" + volumes: + - "${PWD}/backend/inc:/app/inc:ro" + - "${PWD}/backend/server.coffee:/app/server.coffee:ro" + # - "${PWD}/backend/fftcg.db:/app/fftcg.db" + ports: + - "3000:3000" diff --git a/frontend/package.json b/frontend/package.json index c762a9f..00d4419 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,22 +1,38 @@ { - "name": "frontend", + "name": "yvk-fftcg-frontend", "version": "0.1.0", + + "description": "FFTCG online using Socket.IO and CraftyJS on Node.js on Docker", + "author": "JMM ", + "private": true, + "license": "UNLICENSED", + "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, + "dependencies": { "vue": "^2.5.21" }, + "devDependencies": { + "craftyjs": "^0.9.0", + "bootstrap": "^4.1.3", + "jquery": "^3.3.1", + "popper.js": "^1.14.5", + "socket.io-client": "^2.2.0", + "@vue/cli-plugin-babel": "^3.3.0", "@vue/cli-plugin-eslint": "^3.3.0", "@vue/cli-service": "^3.3.0", "babel-eslint": "^10.0.1", "eslint": "^5.8.0", "eslint-plugin-vue": "^5.0.0", + "pug": "^2.0.3", + "pug-plain-loader": "^1.0.0", "vue-template-compiler": "^2.5.21" } }