0

I can't understand where pg_dump version is coming from. I forced everywhere postrgresql-client-13 to be installed.

/usr/bin/pg_dump --version

Celery Beat and Celery

pg_dump (PostgreSQL) 11.12 (Debian 11.12-0+deb10u1)

Other containers (web & postgre and local machine) :

pg_dump (PostgreSQL) 13.4 (Debian 13.4-1.pgdg100+1)

Here is my Dockerfile

FROM python:3
#testdriven turotial they use an other user than root but seemed to fail ehre .
# create directory for the app user
RUN mkdir -p /home/app

ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/staticfiles
WORKDIR $APP_HOME

ENV PYTHONUNBUFFERED 1

RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee  /etc/apt/sources.list.d/pgdg.list

RUN apt-get update -qq && apt-get install -y \
    postgresql-client-13 \
    binutils \
    libproj-dev \
    gdal-bin

RUN apt-get update \
    && apt-get install -yyq netcat
# install psycopg2 dependencies

#install dependencies
RUN pip3 install --no-cache-dir --upgrade pip && pip install --no-cache-dir --no-cache-dir -U pip wheel setuptools
COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt


# copy entrypoint-prod.sh
COPY ./entrypoint.prod.sh $APP_HOME

# copy project
COPY . $APP_HOME

# run entrypoint.prod.sh
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]

and here is my docker-compose

version: '3.7'


services:
  web:
    build:
      context: ./app
      dockerfile: Dockerfile.prod
    command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
    volumes:
      - static_volume:/home/app/web/staticfiles
    expose:
      - 8000
    env_file:
      - ./app/.env.prod
    depends_on:
      - db
  db:
    image: postgis/postgis:13-master
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    env_file:
      - ./app/.env.prod.db

  redis:
    image: redis:6
  celery:
    build: ./app
    command: celery -A core worker -l info
    volumes:
      - ./app/:/usr/src/app/
    env_file:
        - ./app/.env.prod
    depends_on:
      - redis
  celery-beat:
    build: ./app
    command: celery -A core beat -l info
    volumes:
      - ./app/:/usr/src/app/
    env_file:
        - ./app/.env.prod
    depends_on:
      - redis

  nginx-proxy:
    image : nginxproxy/nginx-proxy:latest
    container_name: nginx-proxy
    build: nginx
    restart: always
    ports:
      - 443:443
      - 80:80
    volumes:
      - static_volume:/home/app/web/staticfiles
      - certs:/etc/nginx/certs
      - html:/usr/share/nginx/html
      - vhost:/etc/nginx/vhost.d
      - /var/run/docker.sock:/tmp/docker.sock:ro
    depends_on:
      - web

  nginx-proxy-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    env_file:
      - ./app/.env.prod.proxy-companion
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - certs:/etc/nginx/certs
      - html:/usr/share/nginx/html
      - vhost:/etc/nginx/vhost.d
    depends_on:
      - nginx-proxy

volumes:
  postgres_data:
  static_volume:
  certs:
  html:
  vhost:

I really need to have Celery with the same pg_dump version. Can you guys provide some inputs ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.