feat: switch to using official ruby slim image

Update the Dockerfile to use the official ruby slim image, rather than a custom image. This reduces the Docker image size and improves build times.

- Update the base build and development images to use the official ruby slim image
- Remove redundant arguments in the build and development stages

Using the official ruby slim image simplifies the build process and reduces the image size, resulting in faster build times and a more maintainable Dockerfile.
This commit is contained in:
songtianlun 2025-02-02 00:40:59 +08:00
parent 378530cc1b
commit 2c72e96977

View File

@ -10,8 +10,7 @@
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
# ARG RUBY_VERSION=3.3.5
# FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
ARG BASE_IMAGE=docker.io/songtianlun/today_ai_weather:base_main
FROM ${BASE_IMAGE} AS base
FROM docker.io/songtianlun/today_ai_weather:base_main AS base
# Rails app lives here
WORKDIR /rails
@ -27,8 +26,7 @@ ENV RAILS_ENV="production" \
# Throw-away build stage to reduce size of final image
# FROM base AS build
ARG DEVEl_IMAGE=docker.io/songtianlun/today_ai_weather:devel_main
FROM ${DEVEL_IMAGE} AS build
FROM docker.io/songtianlun/today_ai_weather:devel_main AS build
# Install packages needed to build gems and node modules
# Install JavaScript dependencies