From c004f16c9ac96205eb98db4653cde0ff0b6bf581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Tue, 19 Apr 2022 22:15:13 +0200 Subject: [PATCH] Update Postgres version into Docker Compose configuration --- Dockerfile | 12 +++++++----- docker-compose.yml | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d77a3e3569..04249e55d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,9 @@ RUN apt-get update && apt-get install -y \ imagemagick \ unzip \ libjemalloc-dev \ - libssl-dev + libssl-dev \ + ca-certificates \ + gnupg # Setup ENV variables ENV PATH /usr/local/src/rbenv/shims:/usr/local/src/rbenv/bin:$PATH @@ -41,13 +43,13 @@ RUN git clone --depth 1 https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \ echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && \ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install $(cat .ruby-version) && \ rbenv global $(cat .ruby-version) && \ - gem install bundler --version=1.17.3 + gem install bundler --version=2.3.5 # Install Postgres -RUN sh -c "echo 'deb https://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' > /etc/apt/sources.list.d/pgdg.list" && \ - wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - && \ +RUN sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main' >> /etc/apt/sources.list.d/pgdg.list" && \ + curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null && \ apt-get update && \ - apt-get install -yqq --no-install-recommends postgresql-client-9.5 libpq-dev + apt-get install -yqq --no-install-recommends postgresql-client-10 libpq-dev # Install NodeJs and yarn RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ diff --git a/docker-compose.yml b/docker-compose.yml index 19ddc0fd2f..7bb7988a8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: db: - image: postgres:9.5 + image: postgres:10.19 restart: always environment: POSTGRES_PASSWORD: f00d @@ -36,7 +36,8 @@ services: command: > bash -c "wait-for-it -t 30 db:5432 && rm -f tmp/pids/server.pid && - (bundle check || bundle install) + (bundle check || bundle install) && + bundle exec rake db:create && yarn install && bundle exec rails s -p 3000 -b '0.0.0.0'" webpack: @@ -68,7 +69,7 @@ services: OFN_REDIS_JOBS_URL: redis://redis command: > bash -c "wait-for-it -t 30 db:5432 && - (bundle check || bundle install) + (bundle check || bundle install) && bundle exec sidekiq -q mailers -q default" volumes: gems: