Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: 👋 webpacker #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ services:
- db
- mailcatcher
- cache
- webpack
- dev
env_file: docker/rails.env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
DISABLE_SPRING: 'true'
ports:
- "3000:3000"
Expand All @@ -37,7 +36,6 @@ services:
WAGONS: ''
RAILS_ENV: test
RAILS_TEST_DB_NAME: "hitobito_test_core"
WEBPACKER_DEV_SERVER_HOST: null
RAILS_SPHINX_HOST: null
SKIP_SEEDS: 1
SKIP_BUNDLE_INSTALL: 1
Expand Down Expand Up @@ -104,20 +102,18 @@ services:
- ./docker/test-setup.sql:/docker-entrypoint-initdb.d/test-setup.sql:ro
- db:/var/lib/mysql

webpack:
dev:
build:
context: ./docker
dockerfile: rails.dockerfile
image: ghcr.io/hitobito/development/rails
entrypoint: [ "webpack-entrypoint.sh" ]
entrypoint: [ "dev-entrypoint.sh" ]
env_file: docker/rails.env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
SKIP_BUNDLE_INSTALL: 1

user: "${RAILS_UID:-1000}"
command: /usr/src/app/hitobito/bin/webpack-dev-server
ports:
- "3035:3035"
command: /usr/src/app/hitobito/bin/dev
volumes:
- ./app/:/usr/src/app
- hitobito_bundle:/opt/bundle
Expand Down
2 changes: 1 addition & 1 deletion docker/webpack-entrypoint.sh → docker/dev-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ while ! bundle check >/dev/null 2>&1; do
done

echo "Running yarn install"
bundle exec rails webpacker:yarn_install
yarn install

echo "⚙️ Testing DB connection"
timeout 300s waitfortcp "${RAILS_DB_HOST-db}" "${RAILS_DB_PORT-3306}"
Expand Down
2 changes: 1 addition & 1 deletion docker/rails.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN bash -vxc "gem install bundler -v ${BUNDLER_VERSION}"
RUN bash -vxc 'gem install cmdparse pastel'

COPY ./rails-entrypoint.sh /usr/local/bin
COPY ./webpack-entrypoint.sh /usr/local/bin
COPY ./dev-entrypoint.sh /usr/local/bin
COPY ./waitfortcp /usr/local/bin

RUN mkdir /opt/bundle && chmod 777 /opt/bundle
Expand Down