### Docker compose setup file # This file can be used to quickly set up a development server # with code auto-reloading and automatic execution of migrations. # ## Note # This file is not intended to be used for production. # The "migrate and server" script will automatically apply migrations # and additionally use the Django development server which is # unsuitable for production. version: "3.6" services: postgres: image: postgres:13-alpine ports: - "127.0.0.1:7777:5432" environment: POSTGRES_DB: pysite POSTGRES_PASSWORD: pysite POSTGRES_USER: pysite healthcheck: test: ["CMD-SHELL", "pg_isready -U pysite"] interval: 2s timeout: 1s retries: 5 volumes: - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql web: build: context: . dockerfile: Dockerfile command: ["run", "--debug"] networks: default: aliases: - api.web - admin.web - staff.web ports: - "127.0.0.1:8000:8000" depends_on: postgres: condition: service_healthy tty: true volumes: - .:/app:ro - staticfiles:/var/www/static environment: DATABASE_URL: postgres://pysite:pysite@postgres:5432/pysite METRICITY_DB_URL: postgres://pysite:pysite@postgres:5432/metricity SECRET_KEY: suitable-for-development-only STATIC_ROOT: /var/www/static DEBUG: 1 volumes: staticfiles: