-
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
7 changed files
with
106 additions
and
54 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM registry.docker.com/library/ruby:3.3.1-slim | ||
|
||
ENV APP_PATH /var/app | ||
ENV BUNDLE_VERSION 2.5.10 | ||
ENV BUN_VERSION 1.1.8 | ||
ENV RAILS_PORT 3000 | ||
ENV BUNDLE_PATH /usr/local/bundle | ||
ENV BUNDLE_PATH /usr/local/bundle | ||
ENV GEM_PATH /usr/local/bundle | ||
ENV GEM_HOME /usr/local/bundle | ||
ENV BUN_INSTALL /usr/local/bun | ||
ENV PATH $BUN_INSTALL/bin:$PATH | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
|
||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
|
||
RUN <<EOF | ||
apt-get update | ||
apt-get install -y build-essential libpq-dev curl unzip | ||
EOF | ||
|
||
RUN curl -fsSL https://bun.sh/install | bash -s -- "bun-v${BUN_VERSION}" | ||
|
||
RUN gem install bundler --version "$BUNDLE_VERSION" | ||
|
||
WORKDIR $APP_PATH | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
COPY package.json ./ | ||
|
||
RUN bundle check || bundle install --jobs=8 | ||
RUN bun install | ||
|
||
COPY . . | ||
|
||
EXPOSE $RAILS_PORT |
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 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 |
---|---|---|
@@ -1,58 +1,90 @@ | ||
networks: | ||
development: | ||
volumes: | ||
dbdata: | ||
driver: local | ||
db_data: | ||
gem_cache: | ||
node_modules: | ||
services: | ||
db: | ||
image: postgres:16.3 | ||
container_name: shore_db | ||
networks: | ||
- development | ||
environment: | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password | ||
volumes: | ||
- dbdata:/var/lib/postgresql/data/pgdata | ||
- db_data:/var/lib/postgresql/data/pgdata | ||
web: | ||
build: . | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
networks: | ||
- development | ||
container_name: shore_app | ||
stdin_open: true | ||
tty: true | ||
entrypoint: docker-entrypoint.sh | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- RAILS_ENV=development | ||
- RACK_ENV=development | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_HOST=db | ||
- RAILS_SERVE_STATIC_FILES=false | ||
- VITE_RUBY_HOST=vite | ||
# volumes: | ||
# - .:/app | ||
volumes: | ||
- .:/var/app:cached | ||
- gem_cache:/usr/local/bundle/gems | ||
- node_modules:/var/app/node_modules | ||
depends_on: | ||
- db | ||
command: bundle exec rails s -b 0.0.0.0 -p 3000 | ||
worker: | ||
build: . | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
networks: | ||
- development | ||
container_name: shore_worker | ||
environment: | ||
- RAILS_ENV=development | ||
- RACK_ENV=development | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_HOST=db | ||
- RAILS_SERVE_STATIC_FILES=false | ||
# volumes: | ||
# - .:/app | ||
volumes: | ||
- .:/var/app | ||
- gem_cache:/usr/local/bundle/gems | ||
- node_modules:/var/app/node_modules | ||
depends_on: | ||
- db | ||
command: bundle exec rake solid_queue:start | ||
vite: | ||
build: . | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
container_name: shore_vite | ||
networks: | ||
- development | ||
environment: | ||
- RAILS_ENV=development | ||
- RACK_ENV=development | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_HOST=db | ||
- RAILS_SERVE_STATIC_FILES=false | ||
- VITE_RUBY_HOST=0.0.0.0 | ||
ports: | ||
- "3036:3036" | ||
- "3036:3036" | ||
volumes: | ||
- ./app/frontend:/app/app/frontend | ||
- .:/var/app:cached | ||
- gem_cache:/usr/local/bundle/gems | ||
- node_modules:/var/app/node_modules | ||
depends_on: | ||
- db | ||
command: bundle exec vite dev | ||
command: bundle exec vite dev |
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,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
echo "ENVIRONMENT: $RAILS_ENV" | ||
|
||
# remove any existing pid file | ||
rm -f $APP_PATH/tmp/pids/server.pid | ||
|
||
# database_config_path="$APP_PATH/config/database.yml" | ||
|
||
# rm -f database_config_path | ||
# cp $APP_PATH/config/database.yml.docker "$database_config_path" | ||
|
||
# append bundle exec to every command | ||
bundle exec ${@} |