-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Ruby version used by GH Pages: https://pages.github.com/versions.json
FROM ruby:3.3
WORKDIR /srv/jekyll
# Pre-install gems for caching (these layers survive volume mounts
# since gems are stored in /usr/local/bundle, not /srv/jekyll)
COPY Gemfile jekyll-theme-rtd.gemspec ./
RUN bundle install
# Inline entrypoint script
RUN cat > /usr/local/bin/entrypoint.sh <<'EOF' && chmod +x /usr/local/bin/entrypoint.sh
#!/usr/bin/env bash
set -euo pipefail
bundle install
case "${1:-serve}" in
build)
exec bundle exec jekyll build
;;
serve)
shift || true
exec bundle exec jekyll serve --host 0.0.0.0 --watch --force_polling --livereload "$@"
;;
*)
exec "$@"
;;
esac
EOF
EXPOSE 4000 35729
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["serve"]