Skip to content

Commit 9bdeda8

Browse files
committed
chore: adjust identit
1 parent e8a8721 commit 9bdeda8

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

Dockerfile

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
11
# syntax = docker/dockerfile:1
22

3-
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
43
ARG RUBY_VERSION=3.3.1
5-
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
4+
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base
65

7-
# Rails app lives here
86
WORKDIR /rails
97

10-
# Set production environment
118
ENV RAILS_ENV="development" \
129
BUNDLE_DEPLOYMENT="1" \
13-
BUNDLE_PATH="/usr/local/bundle" \
14-
BUNDLE_WITHOUT="development"
10+
BUNDLE_PATH="/usr/local/bundle"
1511

12+
FROM base AS build
1613

17-
# Throw-away build stage to reduce size of final image
18-
FROM base as build
19-
20-
# Install packages needed to build gems
2114
RUN apt-get update -qq && \
2215
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config
2316

24-
# Install application gems
2517
COPY Gemfile Gemfile.lock ./
2618
RUN bundle install && \
2719
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
2820
bundle exec bootsnap precompile --gemfile
2921

30-
# Copy application code
3122
COPY . .
3223

33-
# Precompile bootsnap code for faster boot times
3424
RUN bundle exec bootsnap precompile app/ lib/
3525

3626

37-
# Final stage for app image
3827
FROM base
3928

40-
# Install packages needed for deployment
4129
RUN apt-get update -qq && \
4230
apt-get install --no-install-recommends -y curl libvips postgresql-client redis-tools && \
4331
rm -rf /var/lib/apt/lists /var/cache/apt/archives
@@ -51,9 +39,8 @@ RUN useradd rails --create-home --shell /bin/bash && \
5139
chown -R rails:rails db log storage tmp
5240
USER rails:rails
5341

54-
# Entrypoint prepares the database.
5542
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
5643

5744
# Start the server by default, this can be overwritten at runtime
5845
EXPOSE 3009
59-
CMD ["./bin/rails", "server"]
46+
CMD ["./bin/rails", "server"]

0 commit comments

Comments
 (0)