GithubHelp home page GithubHelp logo

Rails logger, bybug about dip HOT 7 CLOSED

bibendi avatar bibendi commented on June 7, 2024
Rails logger, bybug

from dip.

Comments (7)

dixpac avatar dixpac commented on June 7, 2024 1

Phew...I manage to make it work. It was not the dip or docker problem, but Rails. Thanks for the quick responses @bibendi

from dip.

dixpac avatar dixpac commented on June 7, 2024 1

@joemsak tbh I don't remember. This was a long time ago, I should have written what was the issue in more details, but :)
I don't use dip anymore, switched to overmind. I still think that dip is awesome project, but overmind works better for my use case.

Sorry!

from dip.

bibendi avatar bibendi commented on June 7, 2024

Hi!

Can you give your docker-compose.yml and dip.yml?

from dip.

dixpac avatar dixpac commented on June 7, 2024

@bibendi ah sorry I should attach my docker-compose and dip when opening issue :)

docker-compose

version: '2.4'

services:
  app: &app
    build:
      context: .
      dockerfile: ./.dockerdev/Dockerfile
      args:
        RUBY_VERSION: '2.6.5'
        PG_MAJOR: '11'
        NODE_MAJOR: '12'
        YARN_VERSION: '1.19.1'
        BUNDLER_VERSION: '2.0.2'
    image: fhirwire-dev:1.0.0
    tmpfs:
      - /tmp

  backend: &backend
    <<: *app
    stdin_open: true
    tty: true
    volumes:
      - .:/app:cached
      - rails_cache:/app/tmp/cache
      - bundle:/usr/local/bundle
      - node_modules:/app/node_modules
      - packs:/app/public/packs
      - .dockerdev/.psqlrc:/root/.psqlrc:ro
    environment:
      - NODE_ENV=development
      - RAILS_ENV=${RAILS_ENV:-development}
      - REDIS_URL=redis://redis:6379/
      - DATABASE_URL=postgres://postgres:postgres@postgres:5432
      - BOOTSNAP_CACHE_DIR=/bundle/bootsnap
      - WEBPACKER_DEV_SERVER_HOST=webpacker
      - WEB_CONCURRENCY=1
      - HISTFILE=/app/log/.bash_history
      - PSQL_HISTFILE=/app/log/.psql_history
      - EDITOR=vi
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  runner:
    <<: *backend
    command: /bin/bash
    ports:
      - '3000:3000'
      - '3002:3002'

  rails:
    <<: *backend
    command: bundle exec rails server -b 0.0.0.0
    ports:
      - '3000:3000'

  sidekiq:
    <<: *backend
    command: bundle exec sidekiq -C config/sidekiq.yml

  postgres:
    image: postgres:10.10
    volumes:
      - .psqlrc:/root/.psqlrc:ro
      - postgres:/var/lib/postgresql/data
      - ./log:/root/log:cached
    environment:
      - PSQL_HISTFILE=/root/log/.psql_history
    ports:
      - 5432
    healthcheck:
      test: pg_isready -U postgres -h 127.0.0.1
      interval: 5s

  redis:
    image: redis:3.2-alpine
    volumes:
      - redis:/data
    ports:
      - 6379
    healthcheck:
      test: redis-cli ping
      interval: 1s
      timeout: 3s
      retries: 30

  webpacker:
    <<: *app
    command: ./bin/webpack-dev-server
    ports:
      - '3035:3035'
    volumes:
      - .:/app:cached
      - bundle:/usr/local/bundle
      - node_modules:/app/node_modules
      - packs:/app/public/packs
    environment:
      - NODE_ENV=${NODE_ENV:-development}
      - RAILS_ENV=${RAILS_ENV:-development}
      - WEBPACKER_DEV_SERVER_HOST=0.0.0.0

volumes:
  postgres:
  redis:
  bundle:
  node_modules:
  rails_cache:
  packs:

dip.yml

version: '4.1'

environment:
  RAILS_ENV: development

compose:
  files:
    - docker-compose.yml

interaction:
  sh:
    description: Open a Bash shell within a Rails container (with dependencies up)
    service: backend
    command: /bin/bash

  bash:
    description: Run an arbitrary script within a container (or open a shell without deps)
    service: backend
    command: /bin/bash
    compose_run_options: [no-deps]

  bundle:
    description: Run Bundler commands
    service: backend
    command: bundle
    compose_run_options: [no-deps]

  rake:
    description: Run Rake commands
    service: backend
    command: bundle exec rake

  rails:
    description: Run Rails commands
    service: backend
    command: bundle exec rails
    subcommands:
      s:
        description: Run Rails server available at http://localhost:3000
        service: rails
        compose:
          run_options: [service-ports, use-aliases]

  'run-tests':
    description: Run mini-test commands within test environment
    service: backend
    environment:
      RAILS_ENV: test
    command: bundle exec rails test

  'run-tests:system':
    description: Run mini-test commands within test environment
    service: backend
    environment:
      RAILS_ENV: test
    command: bundle exec rails test:system

  rubocop:
    service: backend
    command: bundle exec rubocop
    compose_run_options: [no-deps]

  yarn:
    service: backend
    command: yarn
    compose_run_options: [no-deps]

  psql:
    service: postgres
    command: psql -h postgres -U postgres -d fhirwire_development

  'redis-cli':
    service: redis
    command: redis-cli -h redis

provision:
  - dip compose down --volumes
  - dip compose up -d postgres redis
  - dip bundle install
  - dip yarn install
  - dip rails db:create
  - dip rails db:migrate

from dip.

bibendi avatar bibendi commented on June 7, 2024

Your configuration looks good!

Can you elaborate more on this: I try to debug with byebug or pry and when I try to write something to the logs ex; puts "lol" * 100 nothing happens. I'm not sure that I quite understand what do you mean. It would be perfect if you make a screencast.

from dip.

joemsak avatar joemsak commented on June 7, 2024

@dixpac what was the solution? Logging "suddenly" stopped working right for me when I run dip rails s (but not dip up web) and I don't know what I changed

I can actually still use binding.pry as expected but nothing happens after this:

% dip rails s
Creating otherconnection_web_run ... done
Puma starting in single mode...
* Puma version: 5.2.2 (ruby 3.0.0-p0) ("Fettisdagsbulle")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 1
* Listening on http://0.0.0.0:3000
Use Ctrl-C to stop

No controller / request / action / rendering / sql logs, nothing.

from dip.

joemsak avatar joemsak commented on June 7, 2024

No worries thanks so much for writing back @dixpac

from dip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.