Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
takaishi committed Feb 10, 2025
1 parent 9ac9863 commit cb25f9c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ RUN --mount=type=cache,uid=1000,target=/app/.cache/node_modules \
yarn install --modules-folder .cache/node_modules && \
cp -ar .cache/node_modules node_modules

FROM public.ecr.aws/docker/library/ruby:3.3.6 AS fetch-lib
FROM public.ecr.aws/docker/library/ruby:3.3.6-slim AS fetch-lib
WORKDIR /app
COPY --link Gemfile* ./
RUN apt-get update && apt-get install -y shared-mime-info libmariadb3
RUN apt-get update && apt-get install -y shared-mime-info libmariadb3 build-essential libmariadb-dev
RUN bundle install

FROM public.ecr.aws/docker/library/ruby:3.3.6 AS asset-compile
FROM public.ecr.aws/docker/library/ruby:3.3.6-slim AS asset-compile
ENV YARN_VERSION=1.22.22
COPY --link --from=node /opt/yarn-v$YARN_VERSION /opt/yarn
COPY --link --from=node /usr/local/bin/node /usr/local/bin/
Expand All @@ -31,7 +31,6 @@ COPY --link package.json yarn.lock ./
COPY --link --from=node /app/node_modules /app/node_modules
COPY --link --from=fetch-lib /usr/local/bundle /usr/local/bundle
RUN apt-get update && apt-get install -y libvips42
ENV AWS_ACCESS_KEY_ID=''
ARG RAILS_ENV='production'
RUN --mount=type=cache,uid=1000,target=/app/tmp/cache SECRET_KEY_BASE=hoge RAILS_ENV=${RAILS_ENV} DB_ADAPTER=nulldb bin/rails assets:precompile

Expand All @@ -48,13 +47,10 @@ WORKDIR /app
COPY --link --from=node /app/node_modules /app/node_modules
COPY --link --from=fetch-lib /usr/local/bundle /usr/local/bundle
RUN apt-get update && \
apt-get -y install wget libmariadb3 libvips42 gnupg && \
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb [arch=arm64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y google-chrome-stable && \
apt-get -y install wget libmariadb3 libmariadb-dev libvips42 chromium build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV CHROME_BIN=/usr/bin/chromium
COPY --link . .
COPY --link --from=asset-compile /app/public /app/public
EXPOSE 3000
Expand Down

0 comments on commit cb25f9c

Please sign in to comment.