-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
422 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"yaml.schemas": { | ||
"https://json.schemastore.org/yamllint.json": "file:///home/baldarn/Projects/open-GAS/config/deploy.yml" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile | ||
ARG RUBY_VERSION=3.3.4 | ||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base | ||
|
||
# Rails app lives here | ||
WORKDIR /rails | ||
|
||
# Set production environment | ||
ENV RAILS_ENV="development" \ | ||
BUNDLE_PATH="/usr/local/bundle" | ||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM --platform=$TARGETPLATFORM base as build | ||
|
||
# Install packages needed to build gems | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential git libvips libpq-dev pkg-config nodejs | ||
|
||
# Install application gems | ||
COPY Gemfile Gemfile.lock .ruby-version ./ | ||
RUN bundle install && \ | ||
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY | ||
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile | ||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Install packages needed for deployment | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y curl libjemalloc2 libpq-dev libvips nodejs && \ | ||
rm -rf /var/lib/apt/lists /var/cache/apt/archives | ||
|
||
# Copy built artifacts: gems, application | ||
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" | ||
COPY --from=build /rails /rails | ||
|
||
# Entrypoint prepares the application. | ||
ENTRYPOINT ["/rails/bin/docker-entrypoint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
default: &default | ||
adapter: sqlite3 | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 10 } %> | ||
retries: 100 | ||
default_transaction_mode: immediate | ||
adapter: postgresql | ||
pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 10 } %> | ||
host: <%= ENV.fetch('PG_HOST', 'localhost') %> | ||
port: <%= ENV.fetch('PG_PORT', '5432') %> | ||
username: <%= ENV.fetch('PG_USER', 'opengas') %> | ||
password: <%= ENV.fetch('PG_PASSWORD', 'opengas') %> | ||
database: <%= ENV.fetch('PG_DATABASE', "opengas_#{Rails.env}") %> | ||
encoding: unicode | ||
|
||
development: | ||
primary: | ||
<<: *default | ||
database: storage/db/development.sqlite3 | ||
|
||
test: | ||
primary: | ||
<<: *default | ||
database: storage/db/test.sqlite3 | ||
database: <%= ENV.fetch('PG_DATABASE', 'opengas_test') %> | ||
|
||
production: | ||
primary: | ||
<<: *default | ||
database: storage/db/production.sqlite3 | ||
password: <%= ENV.fetch('PG_PRODUCTION_PASSWORD', 'opengas') %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.