[docker-compose question]
hello all! I’ve been stuck on this for a while so hopefully we can debug together.
I’m using docker compose to bring up three separate services.
Everything builds and comes up great. Health check for the app passes, but I can’t seem to hit it from the host.
I’ve tried the following values for app.ports:
“127.0.0.1:3000:3000”
“3000:3000”
“0.0.0.0:3000:3000”
I’ve also tried to run this with a “host” network, but that also didn’t seem to work and I don’t prefer it because apparently that is not supported on Mac and my local developer environment is Macosx. The prod server is ubuntu.
And I’ve tried defining the default bridge netowrk explicitly:
networks:
default:
driver: bridge
version: "2.4"
services:
rabbitmq:
image: rabbitmq
volumes:
- ${ML_FILE_PATH}/taskqueue/config/:/etc/rabbitmq/
environment:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
celery-worker:
image: ${ML_IMAGE_NAME}
entrypoint: "celery --broker='amqp://<user>:<password>@rabbitmq:5672//' -A taskqueue.celeryapp worker --uid 1111"
runtime: ${RUNTIME} ## either "runc" if running locally on debug mode or "nvidia" on production with multi processors
volumes:
- ${ML_FILE_PATH}:/host
depends_on:
- rabbitmq
- app
environment:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
MPLCONFIGDIR: /host/tmp
volumes:
- ${ML_FILE_PATH}:/host
celery-beat:
image: ${ML_IMAGE_NAME}
entrypoint: "celery --broker='amqp://<user>:<password>@rabbitmq:5672//' -A taskqueue.celeryapp beat --uid 1111"
runtime: ${RUNTIME} ## either "runc" if running locally on debug mode or "nvidia" on production with multi processors
depends_on:
- rabbitmq
- app
environment:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
MPLCONFIGDIR: /host/tmp
volumes:
- ${ML_FILE_PATH}:/host
app:
build: .
entrypoint: ${ML_ENTRYPOINT} # just starts a flask app
image: ${ML_IMAGE_NAME}
ports:
- "3000:3000"
expose:
- "3000"
volumes:
- ${ML_FILE_PATH}:/host
restart: always
runtime: ${RUNTIME}
healthcheck:
test: ["CMD", "curl", "http:/localhost:3000/?requestType=health-check"]
start_period: 30s
interval: 30s
timeout: 5s
environment:
SCHEDULER: "off"
TZ: "UTC"
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
Thanks so much for any help!