Created
February 27, 2017 00:26
-
-
Save mateomorrison/1387944d1c4a094567c8ff33717efe90 to your computer and use it in GitHub Desktop.
Deploy Yoonic Nicistore using Docker, Let's Encrypt and Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start a server on Digital Ocean | |
# https://docs.docker.com/machine/drivers/digital-ocean/ | |
docker-machine create \ | |
--driver digitalocean \ | |
--digitalocean-access-token <YOUR API KEY> \ | |
--digitalocean-size 1gb \ | |
yoonic | |
# tell Docker to run commands on that server | |
eval "$(docker-machine env yoonic)" | |
# Nginx SSL Proxy (IMO the best) | |
# https://github.com/GoogleCloudPlatform/nginx-ssl-proxy | |
docker run -d \ | |
--name lets-encrypt \ | |
--volumes-from nginx-proxy \ | |
-v /opt/certs:/etc/nginx/certs:rw \ | |
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
jrcs/letsencrypt-nginx-proxy-companion | |
# Let's Encrypt | |
# https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion | |
docker run -d \ | |
--name lets-encrypt \ | |
--volumes-from nginx-proxy \ | |
-v /opt/certs:/etc/nginx/certs:rw \ | |
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
jrcs/letsencrypt-nginx-proxy-companion | |
# Install Yoonic/Nicistore | |
# https://github.com/yoonic/nicistore | |
# Clone and cd the folder | |
git clone https://github.com/yoonic/nicistore.git && cd nicistore | |
# Build the image | |
docker build -t yoonic/nicistore . | |
# Run Yoonic | |
docker run -d \ | |
--restart always \ | |
--name nicistore \ | |
-p 3000:3000 \ | |
-e ROOT_URL="https://yoursite.com" \ | |
-e VIRTUAL_HOST="yoursite.com" \ | |
-e VIRTUAL_PORT=3000 \ | |
-e LETSENCRYPT_EMAIL="your.email@example.com" \ | |
-e LETSENCRYPT_HOST="yoursite.com" \ | |
-t yoonic/nicistore:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment