FROM ruby:3.3-alpine ARG APK_PROXY RUN if [ -n "$APK_PROXY" ]; then \ cp /etc/apk/repositories /etc/apk/repositories.bak && \ sed -i "s|dl-cdn.alpinelinux.org|$APK_PROXY|g" /etc/apk/repositories ; \ fi RUN apk update && apk add --no-cache \ git COPY . /src/gh/pages-gem ARG GEM_PROXY RUN if [ -n "$GEM_PROXY" ]; then \ bundle config mirror.https://rubygems.org "https://$GEM_PROXY";\ fi # one step to exclude .build_deps from docker cache RUN apk add --no-cache --virtual .build_deps \ make \ build-base && \ bundle config local.github-pages /src/gh/pages-gem && \ bundle install --gemfile=/src/gh/pages-gem/Gemfile && \ apk del .build_deps RUN ln -f -s /src/gh/pages-gem/bin/github-pages /usr/local/bundle/bin/github-pages ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8 WORKDIR /src/site ENTRYPOINT ["github-pages"] CMD ["serve", "-H", "0.0.0.0", "-P", "4000", "-I", "--watch", "--verbose"]