docker-nginx-vue-express-node-sqlite-app-template

A template for web-apps

GPL-3.0 License

Stars
7

docker-nginx-vue-express-node-sqlite-app-template

A template for web-apps

About

This is a template of a web application consisting of a SEVN-stack (sqlite3-express.js-vue.js-node.js), docker, and nginx. The SEVN stack is used to build a multi-page web application using Vue.js as JavaScript framework, Express.js and Node.js as web-framework, and SQLite3 as embedded JSON database. Nginx is used as a reverse-proxy in front of Express.js. The entire app is dockerized, such that building and running can be done easily with hardly any installation steps.

Installation

Download Miniconda first and install everything like this

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

conda create -n web python=3.7
echo "source ~/miniconda3/bin/activate web" >> ~/.bashrc

source ~/miniconda3/bin/activate web
conda install -y nodejs docker-compose

Install Docker. Then build the containers using

docker-compose up -d nginx

This should work. Check it out using

curl localhost:80
curl localhost:4000

If something is returned, the installation worked out and your server runs on port 80. You can rebuild everything using

docker-compose up --build

Debugging

For debugging it makes sense to only build a container for the express app. Instead of installing using docker-compose, use

docker build -t webapp:0.1.0 .
docker run --name webapp -d -p 4000:4000 webapp:0.1.0

Check it out using

curl localhost:4000

If this works, then the express container works fine.

Usage

Run the express app using

docker start webapp
docker start nginx

Stop or remove using:

docker container stop webapp nginx
docker container rm webapp nginx

Author

Simon Dirmeier simon.dirmeier @ web.de

Badges
Extracted from project README
Project Status Build Status codecov Codacy Badge