diff --git a/docker-compose.yml b/docker-compose.yml index 82b691e..ea636a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" @@ -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 @@ -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 diff --git a/docker/webpack-entrypoint.sh b/docker/dev-entrypoint.sh similarity index 92% rename from docker/webpack-entrypoint.sh rename to docker/dev-entrypoint.sh index 7addec5..cd35b3e 100755 --- a/docker/webpack-entrypoint.sh +++ b/docker/dev-entrypoint.sh @@ -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}" diff --git a/docker/rails.dockerfile b/docker/rails.dockerfile index 9ea99da..6cff8c3 100644 --- a/docker/rails.dockerfile +++ b/docker/rails.dockerfile @@ -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