Express-Postgres-Nginx-Docker
Dependencies:
Install Docker
[Docker] https://www.docker.com/
Running the app:
First Time:
Builds the app and starts all the containers
$ bash run.sh build
Running:
Runs all the containers
$ bash run.sh run
Recreate Apidocs
Recreates apidocs from the controllers under /routes
$ bash run.sh apidoc
Run Dev Server
Runs the database container and one app instance
$ bash run.sh dev
Deploying to Digital Ocean
You only need to run three commands on the droplet you create
You will need at least 1GB box (postgres needs at least 1GB to handle 3 connections)
I suggest a Ubuntu 16.04x64 box (1GB/1CPU, 30GB SSD, 2TB Transfer)
$ git clone https://github.com/KorayGocmen/Express-Postgres-Nginx-Docker.git app
$ cd app
$ bash deploy.sh
- App containers do not start with
npm start, they start withpm2-docker start - Migrations are runned automatically by starting the app
sequelize db:migrate
by Koray Gocmen