mirror-web/Dockerfile.build
2024-04-21 13:17:19 +08:00

27 lines
630 B
Docker

FROM ruby:3.2
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@7.3.0/bin/n#v14.17.1" | 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 && \
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 ["jekyll", "build"]