-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (33 loc) · 842 Bytes
/
Dockerfile
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
36
37
38
39
40
41
FROM ruby:3.3.5-alpine3.20
ENV SETUPDIR=/setup
WORKDIR ${SETUPDIR}
ARG GEMFILE_DIR=.
COPY $GEMFILE_DIR/Gemfile* $GEMFILE_DIR/packages* ./
# Install build dependencies
RUN set -eux; \
apk add --no-cache --virtual build-deps \
build-base \
zlib-dev \
;
# Install Bundler
RUN set -eux; gem install bundler
# Install extra packages if needed
RUN set -eux; \
if [ -e packages ]; then \
apk add --no-cache --virtual extra-pkgs $(cat packages); \
fi
# Install gems from `Gemfile` via Bundler
RUN set -eux; bundler install
# Remove build dependencies
RUN set -eux; apk del --no-cache build-deps
# Clean up
WORKDIR /srv/jekyll
RUN set -eux; \
rm -rf \
${SETUPDIR} \
/usr/gem/cache \
/root/.bundle/cache \
;
EXPOSE 4000
ENTRYPOINT ["bundler", "exec", "jekyll"]
CMD ["--version"]