diff --git a/.dockerignore b/.dockerignore index 9dc7e6a..87838f2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,39 +1,4 @@ -# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. - -# Ignore git directory. -/.git/ - -# Ignore bundler config. -/.bundle - -# Ignore all default key files. -/config/master.key -/config/credentials/*.key - -# Ignore all environment files. -/.env* -!/.env.example - -# Ignore all logfiles and tempfiles. -/log/* -/tmp/* -!/log/.keep -!/tmp/.keep - -# Ignore pidfiles, but keep the directory. -/tmp/pids/* -!/tmp/pids/ -!/tmp/pids/.keep - -# Ignore storage (uploaded files in development and any SQLite databases). -/storage/* -!/storage/.keep -/tmp/storage/* -!/tmp/storage/ -!/tmp/storage/.keep - -# Ignore assets. -/node_modules/ -/app/assets/builds/* -!/app/assets/builds/.keep -/public/assets +* +!/public/ +!/config.ru +!/Gemfile* diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4da16e7..0000000 --- a/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -.tags - -/.bundle/ -/.yardoc -/gems.locked -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ - -.rspec_status -.covered.db -/h2spec diff --git a/Dockerfile b/Dockerfile index 2aa0bfb..c3b4c4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,14 @@ -# syntax = docker/dockerfile:1 - -FROM ruby:3.2-alpine - +FROM ruby:3.2-alpine as base WORKDIR /app -RUN apk add build-base +FROM base as build +COPY Gemfile Gemfile.lock . +RUN set -eux; \ + apk add --no-cache build-base; \ + bundle install; -# Install application gems -COPY Gemfile Gemfile.lock ./ -RUN bundle install - -# Copy application code +FROM base as app +COPY --from=build /usr/local/bundle /usr/local/bundle COPY . . - -# Start the server by default, this can be overwritten at runtime EXPOSE 9292 CMD ["puma"]