- Run
make build
to build the image - Run
make dev
to run the server and front end in dev mode- For some reason hot reloading isn't working, browser refresh required.
- Run
make install
to install all dependencies - Run
make api
to run the API on port 3000 - Run
make ui
to run the UI on port 8080
Docker config based on the article How To Secure a Containerized Node.js Application with Nginx, Let's Encrypt, and Docker Compose
- Configure DNS to point to the server's IP
- On the server, replace the contents of
nginx.conf
with the following:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name alexpepper.net www.alexpepper.net;
location / {
proxy_pass http://api:8080;
}
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
}
- Run
sudo make deploy
to run the application and request certificates. - Verify that the certificates were generated correctly.
- Run
sudo make stop
to take the application down. - Undo changes to
nginx.conf
to run on HTTPS. - Run
sudo make deploy
again to deploy the application with SSL. - Sometimes, in order to pick up front-end changes, the web-root volume need to be deleted:
docker volume rm alexpeppernet_web-root