1 Star 0 Fork 0

Admin/chaskiq

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
Miguel Michelson Martinez 提交于 2020-10-25 11:33 . remove package lock
ARG RUBY_VERSION
FROM ruby:$RUBY_VERSION-slim-buster
ARG APP_ENV
ARG PG_MAJOR
ARG NODE_MAJOR
ARG BUNDLER_VERSION
ARG YARN_VERSION
# Copy Installers
RUN mkdir -p /docker-files
COPY .docker-files/ /docker-files
RUN chmod +x /docker-files/*.sh
# Install Dependencies
RUN /docker-files/deps.sh
# Install PostgreSQL
RUN /docker-files/pg.sh
# Install NodeJS, Yarn
RUN /docker-files/node.sh
# Configure bundler
ENV LANG=C.UTF-8 BUNDLE_JOBS=4 BUNDLE_RETRY=3
# Uncomment this line if you want to run binstubs without prefixing with `bin/` or `bundle exec`
# ENV PATH=/app/bin:$BUNDLE_BIN:$PATH
# Upgrade RubyGems and install required Bundler version
RUN gem update --system && \
gem install bundler:$BUNDLER_VERSION
# Change permissions for GEM_HOME
RUN chmod -R 777 $GEM_HOME
# Add docker user
RUN adduser --disabled-password --gecos "" docker && adduser docker staff
# Create and change app directory permissions
RUN mkdir /usr/src/app
RUN chown -R docker:docker /usr/src/app
# Bundler install gems
WORKDIR /tmp
COPY Gemfile Gemfile.lock /tmp/
RUN bundle install -j ${BUNDLE_JOBS} --retry ${BUNDLE_RETRY}
# Clean up APT when done
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log
# Change user and set workdir
USER docker
WORKDIR /usr/src/app
# Copy app source into container
COPY --chown=docker:docker . /usr/src/app/
# Precompile assets - production only
# Clean up temp files and Yarn cache folder
RUN NODE_ENV=${APP_ENV} NODE_OPTIONS="--max-old-space-size=2048" \
SECRET_KEY_BASE=`bin/rake secret` RAILS_ENV=${APP_ENV} \
bundle exec rails assets:precompile \
&& rm -rf /usr/src/app/node_modules /usr/src/app/tmp/cache/* /tmp/* \
&& yarn cache clean
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bjfu_lhy_lanhy2000/chaskiq.git
git@gitee.com:bjfu_lhy_lanhy2000/chaskiq.git
bjfu_lhy_lanhy2000
chaskiq
chaskiq
master

搜索帮助