kcl-digital-humanities-garden/Dockerfile
tobias dfffae35b2
Some checks reported errors
GitHub Pages Deploy / deploy (push) Waiting to run
JS Lint / lint (push) Waiting to run
HTMLProofer / test (2.7) (push) Waiting to run
HTMLProofer / test (3.0) (push) Waiting to run
continuous-integration/drone/push Build encountered an error
Attempt at drone deploy
2024-07-10 10:00:42 +02:00

36 lines
763 B
Docker

# Stage 1: Build the Jekyll site
FROM ruby:3.0.0 AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the specific version of Bundler
RUN gem install bundler:2.2.13
WORKDIR /srv/jekyll
# Copy Gemfile and Gemfile.lock and install dependencies
COPY Gemfile Gemfile.lock ./
RUN bundle _2.2.13_ install
# Copy the rest of the application files
COPY . .
# Build the Jekyll site
RUN jekyll build -d /dist
# Stage 2: Serve the Jekyll site using Nginx
FROM nginx:1.26.0
WORKDIR /usr/share/nginx/html
# Copy the generated site from the builder stage
COPY --from=builder /dist .
# Expose port 80 for the web server
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]