Skip to content

Commit

Permalink
Added support for docker and yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
yatish27 committed Apr 24, 2024
1 parent 06a0860 commit 5ae35cb
Show file tree
Hide file tree
Showing 18 changed files with 2,537 additions and 1,255 deletions.
54 changes: 17 additions & 37 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
# 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 environment files (except templates).
/.env*
!/.env*.erb

# Ignore all default key files.
/config/master.key
/config/credentials/*.key

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/.keep

# Ignore assets.
/node_modules/
/app/assets/builds/*
!/app/assets/builds/.keep
/public/assets
.bundle
.env
.env.*
docker-compose.*
docker/Dockerfile
docker/dockerfiles
log
storage
public/system
tmp
.codeclimate.yml
public/packs
node_modules
vendor/bundle
.DS_Store
*.swp
*~
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
72 changes: 0 additions & 72 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

ruby file: ".ruby-version"
ruby "3.3.0"

gem "bootsnap", require: false
gem "jbuilder"
Expand Down
11 changes: 9 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ GEM
net-smtp
marcel (1.0.4)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.22.3)
msgpack (1.7.2)
mutex_m (0.2.0)
Expand All @@ -166,6 +167,9 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.1)
nokogiri (1.16.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.4-arm-linux)
Expand All @@ -181,6 +185,7 @@ GEM
overmind (2.5.1)
overmind (2.5.1-arm-linux)
overmind (2.5.1-arm64-darwin)
overmind (2.5.1-arm64-linux)
overmind (2.5.1-x86-linux)
overmind (2.5.1-x86_64-darwin)
parallel (1.24.0)
Expand Down Expand Up @@ -239,10 +244,10 @@ GEM
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.2)
reline (0.5.3)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.63.2)
rubocop (1.63.3)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -310,6 +315,8 @@ PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
arm64-linux
ruby
x86-linux
x86_64-darwin
x86_64-linux
Expand Down
3 changes: 0 additions & 3 deletions bin/shims/vite

This file was deleted.

Binary file removed bun.lockb
Binary file not shown.
2 changes: 0 additions & 2 deletions bunfig.toml

This file was deleted.

104 changes: 104 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
services:
rails:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
BUNDLE_WITHOUT: ''
RAILS_ENV: 'development'
RAILS_SERVE_STATIC_FILES: 'false'
tty: true
stdin_open: true
image: shore:latest
env_file: .env
volumes:
- ./:/app:delegated
- node_modules:/app/node_modules
- vite_build:/app/public/vite-dev
- cache:/app/tmp/cache
- bundle:/usr/local/bundle
depends_on:
- postgres
ports:
- 3000:3000
environment:
- RAILS_ENV=development
- VITE_RUBY_HOST=vite
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_HOST=postgres
entrypoint: docker/entrypoints/rails.sh
command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]
solid_queue:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
BUNDLE_WITHOUT: ''
RAILS_ENV: 'development'
RAILS_SERVE_STATIC_FILES: 'false'
tty: true
stdin_open: true
image: shore:latest
env_file: .env
volumes:
- ./:/app:delegated
- node_modules:/app/node_modules
- vite_build:/app/public/vite-dev
- cache:/app/tmp/cache
- bundle:/usr/local/bundle
depends_on:
- postgres
- rails
environment:
- RAILS_ENV=development
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_HOST=postgres
command: ["bundle", "exec", "rake", "solid_queue:start"]
vite:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
BUNDLE_WITHOUT: ''
RAILS_ENV: 'development'
RAILS_SERVE_STATIC_FILES: 'false'
tty: true
stdin_open: true
image: shore:latest
env_file: .env
volumes:
- ./:/app:delegated
- node_modules:/app/node_modules # Node modules shared across containers
- vite_build:/app/public/packs
- cache:/app/tmp/cache
- bundle:/usr/local/bundle
ports:
- 3036:3036
depends_on:
- rails
environment:
- DEBUG='*vite*'
- RAILS_ENV=development
- VITE_RUBY_HOST=0.0.0.0
entrypoint: docker/entrypoints/vite.sh
command: bin/vite dev --clobber
postgres:
image: postgres:16.2
restart: always
ports:
- 5432:5432
volumes:
- postgres:/data/postgres
environment:
- POSTGRES_DB=shore_development
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password

volumes:
postgres:
vite_build:
node_modules:
cache:
bundle:
Loading

0 comments on commit 5ae35cb

Please sign in to comment.