mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
28 lines
777 B
Docker
28 lines
777 B
Docker
FROM ruby:3.2
|
|
LABEL maintainer="Miao Wang <shankerwangmiao@gmail.com>"
|
|
|
|
RUN mkdir /data
|
|
WORKDIR /data
|
|
|
|
RUN \
|
|
apt-get update && \
|
|
apt-get install --no-install-recommends -y locales && \
|
|
apt-get clean
|
|
RUN curl -fsSL "https://cdn.jsdelivr.net/gh/tj/n/bin/n" | bash -s -- lts
|
|
|
|
COPY Gemfile Gemfile.lock package.json package-lock.json /data/
|
|
COPY _node_module_patch /data/_node_module_patch
|
|
|
|
RUN \
|
|
gem install bundler -v "$(sed --silent -r '/BUNDLED WITH/,+1 {s/^[\t ]+//; p}' Gemfile.lock | tail -n +2)" && \
|
|
bundle install --frozen && \
|
|
NODE_ENV=production npm ci && \
|
|
mv node_modules ../ && \
|
|
rm -rf /data/*
|
|
|
|
ENV LANG=C.UTF-8
|
|
ENV JEKYLL_ENV=production
|
|
ENV VITE_RUBY_VITE_BIN_PATH=/node_modules/.bin/vite
|
|
|
|
CMD ["bundle", "exec", "jekyll", "build"]
|