version: "3.9" x-common: website: &website DJANGO_SETTINGS_MODULE: django_project.settings SECRET_KEY: admin FTP_URL: 0.0.0.0:21 USER: admin PASSWORD: admin EMAIL: admin@admin.com postgres: &postgres POSTGRES_DB: website POSTGRES_USER: admin POSTGRES_PASSWORD: admin POSTGRES_HOST: postgres POSTGRES_PORT: 5432 redis: &redis REDIS_URL: redis:6379 services: website: image: marcpartensky/website environment: <<: *website <<: *postgres <<: *redis VIRTUAL_HOST: website.dev build: context: . dockerfile: ./Dockerfile ports: - "127.0.0.1:8000:80" working_dir: /app entrypoint: /app/entrypoint.sh command: 80 0.0.0.0 volumes: - ".:/app" depends_on: - redis - postgres networks: - web healthcheck: test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"] interval: 1m30s timeout: 10s retries: 3 start_period: 40s postgres: image: postgres environment: <<: *postgres ports: - "127.0.0.1:5432:5432" networks: - web # pgadmin: # image: dpage/pgadmin4 # restart: unless-stopped # environment: # PGADMIN_DEFAULT_EMAIL: admin@admin.com # PGADMIN_DEFAULT_PASSWORD: admin # VIRTUAL_HOST: postgres.dev # volumes: # - dev_pgadmin:/var/lib/pgadmin # ports: # - "15432:80" # networks: # - web pgweb: image: sosedoff/pgweb restart: unless-stopped ports: - "127.0.0.1:15432:8081" environment: DATABASE_URL: "postgres://admin:admin@postgres:5432/website?sslmode=disable" networks: - web depends_on: - postgres redis: image: redis environment: <<: *redis ports: - "127.0.0.1:6379:6379" networks: - web rediscommander: image: rediscommander/redis-commander restart: unless-stopped environment: VIRTUAL_HOST: redis.dev REDIS_HOST: redis:6379 ports: - "127.0.0.1:16379:8081" networks: - web # website-test: # environment: # <<: *website # <<: *postgres # <<: *redis # VIRTUAL_HOST: website.dev # build: # context: . # dockerfile: ./Dockerfile # working_dir: /app # entrypoint: /app/entrypoint.sh # command: 80 0.0.0.0 # volumes: # - ".:/app" # networks: # - web # - caddy # healthcheck: # test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"] # interval: 1m30s # timeout: 10s # retries: 3 # start_period: 40s # labels: # - "caddy=test.marcpartensky.com" # - "caddy.reverse_proxy={{upstreams http 80}}" test: image: jwilder/dockerize networks: - web command: -wait http://website:8080/healthcheck -timeout 120s -wait-retry-interval 5s networks: web: caddy: external: true volumes: dev_posgres: dev_pgadmin: