Skip to content

Commit

Permalink
Update Postgres version into Docker Compose configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
François Turbelin committed Apr 19, 2022
1 parent 268a73a commit c004f16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Expand Up @@ -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
Expand All @@ -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 - \
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
db:
image: postgres:9.5
image: postgres:10.19
restart: always
environment:
POSTGRES_PASSWORD: f00d
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c004f16

Please sign in to comment.