SJTUG mirror docker, based on tunasync/jekyll
Follow these steps before building the images.
Prepare a gzipped tunasync tar ball without version directory (as if generated
by git archive without --prefix), rename it to tunasync.tar.gz, and
place it into tunasync/.
You may run
$ cd tunasync
$ ../utils/genpack.sh tunasyncto generate it automatically.
Suppose the static web contents are supposed to store in /home/mirror-web.
Fetch the latest mirror-web and build the pages. You should have working
jekyll installed.
$ utils/genpack.sh mirror-web # may generate an extra .tar.gz, just ignore it
$ cd mirror-web
$ jekyll build -d /home/mirror-web/_siteNote that the actual content is stored in the subdir _site.
You may also build the pages elsewhere and deploy them in the server.
The configuration of nginx in this project requires key suite to support HTTPS.
Key suite could be acquired from let's encrypt for free through acme.sh client.
After your site became accessible from your domain,
acquire_cert.sh provides a convinient way to get key suite. If not, please refer to
https://github.com/Neilpang/acme.sh#use-standalone-server-to-issue-cert for steps.
source acquire_cert.sh your_website your_site_rootAfter this step, key suite should be placed under ~/.acme.sh/your_website/.
There are two ways to build an run, the manual way and the docker-compose
way. The latter is recommended.
$ utils/prepare.shNOTE: after renewal of your key suite please run this step again to use the latest version.
Suppose the static web contents are stored in /home/mirror-web, and the
super-massive mirror filesystem is /home/mirrors.
The mounting point in docker containers are /mnt/mirror-web and
/mnt/mirrors respectively.
$ docker run --name mirrors_tunasync -d \
-v /home/mirrors:/mnt/mirrors:Z \
-v /home/mirror-web:/mnt/mirror-web:Z \
sjtug/mirror-tunasync
$ docker run --name mirrors_nginx -d -p 80:80 \
-v /home/mirrors:/mnt/mirrors:Z \
-v /home/mirror-web:/mnt/mirror-web:Z \
sjtug/mirror-nginxAfter preparation, configure storage volume path in docker-compose.yml, then
simply run
$ docker-compose -p sjtug up -dDiscussions and pull requests are strongly encouraged.
GPLv3, except for files with specifications.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.