Skip to content

Commit

Permalink
Docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio-e committed Jul 12, 2024
1 parent cb97d76 commit 6bdf67a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.3.0
ARG RUBY_VERSION=3.3.3
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base

# Rails app lives here
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
Expand Down Expand Up @@ -434,6 +436,7 @@ GEM
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
railties (>= 7.1)
sqlite3 (1.7.3-aarch64-linux)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-linux)
standard (1.39.0)
Expand All @@ -452,6 +455,8 @@ GEM
railties (>= 6.0.0)
stringio (3.1.1)
strscan (3.1.0)
tailwindcss-rails (2.6.1-aarch64-linux)
railties (>= 7.0.0)
tailwindcss-rails (2.6.1-arm64-darwin)
railties (>= 7.0.0)
tailwindcss-rails (2.6.1-x86_64-linux)
Expand Down Expand Up @@ -489,6 +494,7 @@ GEM
zeitwerk (2.6.16)

PLATFORMS
aarch64-linux
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
1. Run `bin/setup` (needs to be run only once)
2. Run `bin/dev`

or

1. Run `docker compose up`

## Linting & Formatting

#### Ruby
Expand Down
16 changes: 8 additions & 8 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#
# Table name: users
#
# id :integer not null, primary key
# email :string not null
# in_app_notifications_enabled :boolean default(TRUE), not null
# mail_notifications_enabled :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# email :string not null
# in_app_notifications :boolean default(TRUE), not null
# mail_notifications :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20240628211820_create_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ def change
create_table :users do |t|
t.string :email, null: false
t.string :role
t.boolean :mail_notifications_enabled, default: true, null: false
t.boolean :in_app_notifications_enabled, default: true, null: false
t.boolean :mail_notifications, default: true, null: false
t.boolean :in_app_notifications, default: true, null: false
t.string :password_digest, null: false

t.timestamps
Expand Down
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
app:
build: .
ports:
- 3000:3000
volumes:
- ".:/rails"
environment:
- RAILS_ENV=development
tty: true # Needed to use binding.pry
stdin_open: true # Needed to use binding.pry
command: bundle exec rails server -b 0.0.0.0
16 changes: 8 additions & 8 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#
# Table name: users
#
# id :integer not null, primary key
# email :string not null
# in_app_notifications_enabled :boolean default(TRUE), not null
# mail_notifications_enabled :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# email :string not null
# in_app_notifications :boolean default(TRUE), not null
# mail_notifications :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
Expand Down
16 changes: 8 additions & 8 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#
# Table name: users
#
# id :integer not null, primary key
# email :string not null
# in_app_notifications_enabled :boolean default(TRUE), not null
# mail_notifications_enabled :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
# id :integer not null, primary key
# email :string not null
# in_app_notifications :boolean default(TRUE), not null
# mail_notifications :boolean default(TRUE), not null
# password_digest :string not null
# role :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
Expand Down

0 comments on commit 6bdf67a

Please sign in to comment.