Docker Community Forums

Share and learn in the Docker community.

First Docker composer error ``` depends_on```

I get this error:

Unsupported config option for services.nginx: 'depends on'

and it won’t let me start this configuration file in order to create an image so I can work on my Laravel 8 application, what am I doing wrong?

version: '3.9'

networks:
    laravel:

services:
    nginx:
        image: nginx:stable-alpine
        container_name: nginx
        ports:
            - "8088:80"
        volumes:
            - ./src:/var/www/html
            - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
        depends on:
            - php
            - mysql
        networks:
            - laravel

        mysql:
            image: mysql:5.7.22
            container_name: mysql
            restart: unless-stopped
            tty: true
            ports: 
                - "4306:3306"
            volumes:
                - ./mysql:/var/lib/mysql
            environment:
                MYSQL_DATABASE: homestead
                MYSQL_USER: homestead
                MYSQL_PASSWORD: secret
                MYSQL_ROOT_PASSWORD: secret
                SERVICE_TAGS: dev
                SERVICE_NAME: mysql
            networks: 
                - laravel

            php:
                build:
                    context: .
                    dockerfile: Dockerfile
                container_name: php
                volumes:
                    -   ./src:/var/www/html
                ports: 
                    - "9000:9000"      
                networks:
                    - laravel
server {
    listen 80;
    index index.php index.html;
    server_name localhost;
    error_log: /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/html/public;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ˜ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info = ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

Thanks!