Last active
February 15, 2021 21:14
-
-
Save mazz/644785fa75d7b50343404e3df60ea496 to your computer and use it in GitHub Desktop.
jekyll deploy static site
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
## jekyll deploy | |
adduser jekyll | |
adduser jekyll sudo | |
su jekyll ; cd /home | |
mkdir ~/.ssh ; cd .ssh | |
cat >> ~/.ssh/authorized_keys | |
ssh-rsa <pubkey> | |
sudo chmod 700 -R ~/.ssh && chmod 600 ~/.ssh/authorized_keys | |
mkdir -p /home/jekyll/static/my_app | |
### dev machine, copy cwd of static files up to site | |
scp -r * -i ~/.ssh/id_rsa_mby.pem jekyll@myapp.xyz:/home/jekyll/static/my_app | |
ssh -i ~/.ssh/id_rsa_mby.pem jekyll@198.211.104.172 | |
cd static/ | |
# jekyll/docker-compose.yml | |
cp docker-compose.yml my_app/ | |
cd my_app/ | |
sudo docker-compose up |
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
version: '3' | |
services: | |
jekyll: | |
image: jekyll/jekyll:latest | |
command: > | |
bash -c "/bin/chown -R jekyll /srv/jekyll | |
&& jekyll serve --port 3000 --watch --force_polling --verbose" | |
ports: | |
- 3000:3000 | |
volumes: | |
- .:/srv/jekyll | |
networks: | |
- proxy-network | |
labels: | |
- "traefik.enable=true" | |
- "traefik.port=3000" | |
- "traefik.http.routers.markably-app.entrypoints=http" | |
- "traefik.http.routers.markably-app.rule=Host(`markably.app`)" | |
- "traefik.http.middlewares.markably-app-https-redirect.redirectscheme.scheme=https" | |
- "traefik.http.routers.markably-app.middlewares=markably-app-https-redirect" | |
- "traefik.http.routers.markably-app-secure.entrypoints=https" | |
- "traefik.http.routers.markably-app-secure.rule=Host(`markably.app`)" | |
- "traefik.http.routers.markably-app-secure.tls=true" | |
- "traefik.http.routers.markably-app-secure.tls.certresolver=http" | |
- "traefik.http.routers.markably-app-secure.service=markably-app" | |
- "traefik.http.services.markably-app.loadbalancer.server.port=3000" | |
- "traefik.docker.network=proxy-network" | |
networks: | |
proxy-network: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment