Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi all!
I have two different apps with two different docker-compose.yml files in different directories. I have a python flask app that fetches data from internet and stores it in a PostgreSQL database. This is working perfectly so far. This app should only accept connections from localhost. The second app is a Golang app that fetches data from internet but should also make requests to the first app, get that data and store it in a PostgreSQL database.
I have tried and my setup works perfectly in my local development machine, but it doesn’t work when it’s deployed in a droplet, and I’ve been trying for a week and I can’t find out why.
From my golang app code, I’m making a GET request to http://jobs-web:5000 or http://jobs:5000 and I’m getting an EOF error.
Here’s my two compose files:
First python app:
web:
container_name: jobs-web
build: .
command:
[
"gunicorn",
"-b",
"0.0.0.0:5000",
"app:create_app()",
"--log-level",
"debug",
"--access-logfile",
"-",
"--error-logfile",
"-",
"--timeout",
"0",
"--preload",
]
environment:
ENABLE_SCHEDULER: ${ENABLE_SCHEDULER}
FLASK_ENV: production
SQLALCHEMY_DATABASE_URI: ${SQLALCHEMY_DATABASE_URI}
volumes:
- .:/app
depends_on:
- db
networks:
- fullstack
db:
container_name: jobs-db
image: postgres:16.4-alpine3.20
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
- ./.env:/app/.env
networks:
- fullstack
networks:
fullstack:
external: true
volumes:
postgres_data:
test_postgres_data:
Second Goland app:
services:
remoti-db:
image: postgres:16.4-alpine3.20
container_name: remoti-db
ports:
- 5432:5432
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
networks:
- remoti-network
volumes:
- database_postgres:/var/lib/postgresql/data
healthcheck:
test: [CMD-SHELL, "pg_isready -U ${DB_USERNAME}"]
interval: 3s
timeout: 3s
retries: 5
expose:
- "5432"
app:
build:
context: .
dockerfile: Dockerfile
container_name: remoti-app
ports:
- 4000:4000
depends_on:
remoti-db:
condition: service_healthy
networks:
- fullstack
- remoti-network
prometheus:
image: prom/prometheus
ports:
- 9090:9090
volumes:
- prometheus:/prometheus
- ./prometheus/development.yml:/etc/prometheus/prometheus.yml
networks:
- remoti-network
grafana:
image: grafana/grafana
ports:
- 3000:3000
depends_on:
- prometheus
networks:
- remoti-network
volumes:
- grafana:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/dashboards:/etc/dashboards
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
migrations:
image: migrate/migrate:latest
env_file:
- .env
command: -path /migrations -database ${DSN} up
volumes:
- ./migrations:/migrations
networks:
- remoti-network
depends_on:
remoti-db:
condition: service_healthy
volumes:
database_postgres:
migrations:
prometheus:
grafana:
networks:
fullstack:
external: true
remoti-network:
driver: bridge
2423141f9d5747a2af463e08719216
2713a5b199454ab18486b60c0d33bd
lwmeozrcbh
d1dd3d9538cc4d06b53e6d1d338d3f
50ff4e4b3c6c4999a12403b1ecda95
a6309a057c3f4cb38fb2e7feb67236
72e571841e7f4a6881090a2f3e93c0
7ce6bf277bff4d429ba493dd750e35
57a72a98162f46a5a5cd04d9b
Thomas Brocken