Browse Source

Add docker files

dockerfile and docker-compose have not been tested.
master
Haris Razis 4 years ago
parent
commit
db9c2b764e
  1. 8
      README.md
  2. 18
      docker/docker-compose.yml
  3. 9
      routes/users.js
  4. 0
      web/app.js
  5. 0
      web/bin/www
  6. 0
      web/config/creds.js
  7. 19
      web/dockerfile
  8. 0
      web/locales/el.json
  9. 0
      web/locales/en.json
  10. 2
      web/package-lock.json
  11. 7
      web/package.json
  12. 0
      web/public/images/annie-spratt-QckxruozjRg-unsplash.jpg
  13. 0
      web/public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg
  14. 0
      web/public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg
  15. 0
      web/public/images/yancy-min-842ofHC6MaI-unsplash.jpg
  16. 0
      web/public/javascripts/bs-init.js
  17. 0
      web/public/javascripts/fetchLabs.js
  18. 0
      web/public/stylesheets/Footer-Dark.css
  19. 0
      web/public/stylesheets/Navigation-with-Button.css
  20. 0
      web/public/stylesheets/bootstrap.min.css
  21. 1
      web/routes/index.js
  22. 0
      web/views/error.ejs
  23. 0
      web/views/index.ejs

8
README.md

@ -1 +1,7 @@
swarmlab.io
# *[swarmlab.io](www.docs.swarmlab.io)*
Swarmlab is a powerful collaboration tool that connects tutors and students in a unique all-in-one environment that gets work done fast and easily.

18
docker/docker-compose.yml

@ -0,0 +1,18 @@
version: "3.8"
services:
webapp:
build: ../web
dockerfile: dockerfile
image: webapp:latest
deploy:
mode: replicated
replicas: 2
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s
placement:
max_replicas_per_node: 1
constraints:
- "node.role==manager"

9
routes/users.js

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
module.exports = router;

0
app.js → web/app.js

0
bin/www → web/bin/www

0
public/javascripts/fetchLabs.js → web/config/creds.js

19
web/dockerfile

@ -0,0 +1,19 @@
FROM node:latest
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "node", "./bin/www" ]

0
locales/el.json → web/locales/el.json

0
locales/en.json → web/locales/en.json

2
package-lock.json → web/package-lock.json

@ -1,6 +1,6 @@
{
"name": "swarmlab.io",
"version": "0.0.0",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

7
package.json → web/package.json

@ -1,9 +1,10 @@
{
"name": "swarmlab.io",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "nodemon ./bin/www"
"start": "node ./bin/www",
"dev": "nodemon ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.4",
@ -18,4 +19,4 @@
"morgan": "~1.9.1",
"nodemon": "^2.0.4"
}
}
}

0
public/images/annie-spratt-QckxruozjRg-unsplash.jpg → web/public/images/annie-spratt-QckxruozjRg-unsplash.jpg

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 327 KiB

0
public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg → web/public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg

Before

Width:  |  Height:  |  Size: 370 KiB

After

Width:  |  Height:  |  Size: 370 KiB

0
public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg → web/public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

0
public/images/yancy-min-842ofHC6MaI-unsplash.jpg → web/public/images/yancy-min-842ofHC6MaI-unsplash.jpg

Before

Width:  |  Height:  |  Size: 475 KiB

After

Width:  |  Height:  |  Size: 475 KiB

0
public/javascripts/bs-init.js → web/public/javascripts/bs-init.js

0
web/public/javascripts/fetchLabs.js

0
public/stylesheets/Footer-Dark.css → web/public/stylesheets/Footer-Dark.css

0
public/stylesheets/Navigation-with-Button.css → web/public/stylesheets/Navigation-with-Button.css

0
public/stylesheets/bootstrap.min.css → web/public/stylesheets/bootstrap.min.css

1
routes/index.js → web/routes/index.js

@ -1,7 +1,6 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', (req, res, next) => {
res.render('index');
});

0
views/error.ejs → web/views/error.ejs

0
views/index.ejs → web/views/index.ejs

Loading…
Cancel
Save