Hi, Does anyone has prefect 2.16 version docker-co...
# prefect-getting-started
n
Hi, Does anyone has prefect 2.16 version docker-compose. I want to setup prefect using dockers on my local.
j
we use this
Copy code
services:
  prefect:
    restart: always
    container_name: prefect.api
    image: prefecthq/prefect:2-python3.8
    volumes:
      - ${PWD}/prefect_storage_data:/prefect-storage
    environment:
      - PREFECT_DB_PW=${PREFECT_DB_PW}
    ports:
      - "4200:4200"
    depends_on:
      - database

  database:
    restart: always
    image: postgres:14
    container_name: prefect.db
    volumes:
      - ${PWD}/prefect_db_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=prefect
      - POSTGRES_USER=prefect
      - POSTGRES_PASSWORD=${PREFECT_DB_PW}
n
currently i am using 2.7.7 which has a agent, below is my docker compose for 2.7.7
Copy code
version: "3.7"
services:
   database:
     image: postgres:15.1-alpine
     restart: always
     container_name: database
     environment:
        - POSTGRES_USER=postgres
        - POSTGRES_PASSWORD=postgres
        - POSTGRES_DB=orion
     expose:
        - 5432
     volumes:
        - db:/var/lib/postgresql/data
     networks:
        - carpl_docker_backend

   orion:
     build: .
     container_name: orion
     restart: always
     command: prefect orion start --host 0.0.0.0
     environment:
        - PREFECT_ORION_API_HOST=0.0.0.0
        - PREFECT_ORION_DATABASE_CONNECTION_URL=<postgresql+asyncpg://postgres:postgres@database:5432/orion>
        - PREFECT_API_URL=<http://172.16.12.6:4200/api>
     ports:
        - "4200:4200"
     networks:
        - backend

   agent:
    build: .
    container_name: agent
    restart: always
    command: /bin/bash -c "./entrypoint.prod.sh -q algo-3001 -q algo-3002 -q algo-13 -q algo-3003 -q algo-3004 -q algo-3005"
    environment:
      - INFERENCING_SERVICE_NAME=remote-file-system
      - PREFECT_ORION_API_HOST=0.0.0.0
      - PREFECT_ORION_DATABASE_CONNECTION_URL=<postgresql+asyncpg://postgres:postgres@database:5432/orion>
      - PREFECT_API_URL=<http://172.16.12.6:4200/api>
    volumes:
      - tmp:/tmp:rw
      - ./flows:/opt/prefect/flows
    networks:
      - carpl_docker_backendvolumes:
  db:
  tmp:


networks:
  carpl_docker_backend:
      external: true
j
I don't know about that upgrade path, we started at 2.13
n
In the agent service we mentioned the queue, i was not able to figure out how can i mention the queue or workpool in the docker compose that you provided
j
This docker compose is for the server, the workers we run directly on the machine using systemd and they then start docker images as needed. The workers for us don't run in docker themselves. We configure the workpools in the UI
n
Ohh Okay, Thanks will start working on this
i tried using the docker-compose that you provided but docker container failed to start. this is the logs that is printing. I am not able to figureout what exactly i am doing wrong
j
could it be that it tries to start the server before the db is ready?
n
i tried restarting the docker again thinking now that db is started it will make connection but still the same error
i
If you setup dependancies between containers, they will wait for eachother in the right order
@Nimesh Kumar any progress about this? Have the same issue and my DB is already running on another server