-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 971 Bytes
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 971 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
36
37
38
39
40
41
42
43
44
45
46
47
48
## Build a Docker image for jekyll 4.3.2
FROM ruby:3.2.2-alpine3.19
ENV APPDIR=/srv/jekyll
ENV SETUPDIR=/setup
ENV GEM_HOME=/usr/local/bundle
ENV BUNDLE_PATH=$GEM_HOME
ENV BUNDLE_GEMFILE=$SETUPDIR/Gemfile
ENV PATH $GEM_HOME/bin:$PATH
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 extra packages if needed
RUN set -eux; \
apk add --no-cache git;
# Install Bundler
RUN set -eux; gem install bundler
# 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
RUN set -eux; \
rm -rf \
${SETUPDIR} \
/usr/gem/cache \
/root/.bundle/cache \
;
ENV BUNDLE_GEMFILE=$APPDIR/Gemfile
WORKDIR ${APPDIR}
EXPOSE 4000
ENTRYPOINT ["bundle", "exec", "rake"]