Attempt at drone deploy
Some checks reported errors
Some checks reported errors
This commit is contained in:
35
Dockerfile
35
Dockerfile
@ -1,30 +1,35 @@
|
||||
FROM ruby:3.0.0 as jekyll
|
||||
# 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/*
|
||||
|
||||
# used in the jekyll-server image, which is FROM this image
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
# Install the specific version of Bundler
|
||||
RUN gem install bundler:2.2.13
|
||||
|
||||
RUN gem update --system && gem install jekyll && gem cleanup
|
||||
WORKDIR /srv/jekyll
|
||||
|
||||
EXPOSE 4000
|
||||
# Copy Gemfile and Gemfile.lock and install dependencies
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
RUN bundle _2.2.13_ install
|
||||
|
||||
WORKDIR /site
|
||||
# Copy the rest of the application files
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT [ "jekyll" ]
|
||||
# Build the Jekyll site
|
||||
RUN jekyll build -d /dist
|
||||
|
||||
CMD [ "--help" ]
|
||||
# Stage 2: Serve the Jekyll site using Nginx
|
||||
FROM nginx:1.26.0
|
||||
|
||||
# build from the image we just built with different metadata
|
||||
FROM jekyll as jekyll-serve
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
COPY --from=jekyll /usr/local/bin/docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
# Copy the generated site from the builder stage
|
||||
COPY --from=builder /dist .
|
||||
|
||||
# on every container start, check if Gemfile exists and warn if it's missing
|
||||
ENTRYPOINT [ "docker-entrypoint.sh" ]
|
||||
# Expose port 80 for the web server
|
||||
EXPOSE 80
|
||||
|
||||
CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
Reference in New Issue
Block a user