frosch said over 3 years ago on In Depth with Docker Compose :
Hey iam using docker with 6 rails microservices. Everytime i start the containers i get huge output of logs, is there a way to minify that? Just want to give out something like " 6 of 6 containers startet succesfully" as example.

David Kimura PRO said over 3 years ago on In Depth with Docker Compose :
If you want to silent some of the services, you can use something like this. It will disable the logs. https://docs.docker.com/config/containers/logging/configure#supported-logging-drivers ``` redis: image: redis:latest logging: driver: none ```

jim.technologist PRO said about 3 years ago on In Depth with Docker Compose :
I am successfully running the code for this episode. Except the test database will not create due to this error:
PG::ConnectionBad: could not translate host name "postgres://postgres:postgres@postgres:5432" to address: Name or service not known

Advice?

David Kimura PRO said about 3 years ago on In Depth with Docker Compose :
  Is the postgres instance running? You can run docker container ls to see.  You can also run docker logs CONTAINER_NAME to see if there is something else weird going on.

David Kimura PRO said almost 3 years ago on In Depth with Docker Compose :
If anyone is wanting to use an Alpine version of a Ruby image, here's what I'm using. I've included some commented out lines which you can replace the postgresql-dev with the sqlite or mysql (mariadb) depending on the database you're using.

FROM ruby:2.6.6-alpine3.12
LABEL MAINTAINER=dave@k-innovations.net

# sqlite-dev \
# mariadb-dev \
RUN apk add --no-cache --update build-base \
  git \
  postgresql-dev \
  nodejs \
  yarn \
  tzdata \
  && rm -rf /var/cache/apk/*

RUN bundle config --global frozen 1

COPY Gemfile Gemfile.lock ./
RUN gem update --system
RUN gem install bundler
RUN bundle install -j $(nproc)

RUN mkdir -p /app
WORKDIR /app

This helped reduce the base image from 2GB to 1GB.

Login to Comment