Docker Community Forums

Share and learn in the Docker community.

Docker-compose Windows running, cannot access site from browser

I am attempting to run a docker container on my Windows 10 machine. I am able to start the instance of docker, but cannot access it locally on my browser. I keep getting HTTP 500 errors.

versions:
docker desktop: 2.0.0.3
compose: 1.23.2

here is what docker inspect returns:

[
{
    "Id": "e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9",
    "Created": "2019-04-01T18:01:06.7102237Z",
    "Path": "/bin/sh",
    "Args": [
        "-c",
        "apache2ctl -D FOREGROUND"
    ],
    "State": {
        "Status": "running",
        "Running": true,
        "Paused": false,
        "Restarting": false,
        "OOMKilled": false,
        "Dead": false,
        "Pid": 2866,
        "ExitCode": 0,
        "Error": "",
        "StartedAt": "2019-04-01T18:26:12.0263374Z",
        "FinishedAt": "2019-04-01T18:24:41.1540249Z"
    },
    "Image": "sha256:98df0c936bc1b3b5de4b0a1ef24129d026561d80872a1ad226a51aadfff08883",
    "ResolvConfPath": "/var/lib/docker/containers/e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9/resolv.conf",
    "HostnamePath": "/var/lib/docker/containers/e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9/hostname",
    "HostsPath": "/var/lib/docker/containers/e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9/hosts",
    "LogPath": "/var/lib/docker/containers/e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9/e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9-json.log",
    "Name": "/site",
    "RestartCount": 0,
    "Driver": "overlay2",
    "Platform": "linux",
    "MountLabel": "",
    "ProcessLabel": "",
    "AppArmorProfile": "",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [
            "/host_mnt/c/Users/heena/Desktop/workspace/powerspike/ps-site:/var/www:rw"
        ],
        "ContainerIDFile": "",
        "LogConfig": {
            "Type": "json-file",
            "Config": {}
        },
        "NetworkMode": "ps-site_default",
        "PortBindings": {
            "80/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "80"
                }
            ]
        },
        "RestartPolicy": {
            "Name": "",
            "MaximumRetryCount": 0
        },
        "AutoRemove": false,
        "VolumeDriver": "",
        "VolumesFrom": [],
        "CapAdd": null,
        "CapDrop": null,
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": null,
        "GroupAdd": null,
        "IpcMode": "shareable",
        "Cgroup": "",
        "Links": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "SecurityOpt": null,
        "UTSMode": "",
        "UsernsMode": "",
        "ShmSize": 67108864,
        "Runtime": "runc",
        "ConsoleSize": [
            0,
            0
        ],
        "Isolation": "",
        "CpuShares": 0,
        "Memory": 0,
        "NanoCpus": 0,
        "CgroupParent": "",
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "BlkioDeviceReadBps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteIOps": null,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "Devices": null,
        "DeviceCgroupRules": null,
        "DiskQuota": 0,
        "KernelMemory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "OomKillDisable": false,
        "PidsLimit": 0,
        "Ulimits": null,
        "CpuCount": 0,
        "CpuPercent": 0,
        "IOMaximumIOps": 0,
        "IOMaximumBandwidth": 0,
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ]
    },
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/d40188bfd395071ed83393e40bd0c8b57848e1ae4ac030238a839a72e01ce9a1-init/diff:/var/lib/docker/overlay2/43fedfe310c21b1a1edfbef7c51b0fd87606461352230b835e41ac2403227a08/diff:/var/lib/docker/overlay2/4b028fc80f14af710adac676d9931299f8a594a0035e3957eb001c51a8ccb3a8/diff:/var/lib/docker/overlay2/bcefc9541f625b86e16a9d46c4dd5c12fa51255467af743dda5420e9afd82225/diff:/var/lib/docker/overlay2/1434f0d96bad46388afb0d32b2fa7a43760598b6b8ef344d5c5a31a6fb64725f/diff:/var/lib/docker/overlay2/d6930c7ce320f98e26a1ffac7efdce7bcfd73e5635edd63e334913d29f25ba00/diff:/var/lib/docker/overlay2/08f4791179132c7c4946e40f7e5c6ec538eaf493ea01563dd3f6780ccc3d3639/diff:/var/lib/docker/overlay2/4dde7990401eb804282fb660c3db2cde7c2addd56af04f5eeb94497b6a1a9898/diff:/var/lib/docker/overlay2/b5aab5207e4a6b1bcdf77560260e6c654537ea0160bd115b80a8fb27caec8609/diff:/var/lib/docker/overlay2/040a5d8bcf321dc3b0a4616f3e53de05cdae65120164863d714e7aa0d4449f5e/diff",
            "MergedDir": "/var/lib/docker/overlay2/d40188bfd395071ed83393e40bd0c8b57848e1ae4ac030238a839a72e01ce9a1/merged",
            "UpperDir": "/var/lib/docker/overlay2/d40188bfd395071ed83393e40bd0c8b57848e1ae4ac030238a839a72e01ce9a1/diff",
            "WorkDir": "/var/lib/docker/overlay2/d40188bfd395071ed83393e40bd0c8b57848e1ae4ac030238a839a72e01ce9a1/work"
        },
        "Name": "overlay2"
    },
    "Mounts": [
        {
            "Type": "bind",
            "Source": "/host_mnt/c/Users/heena/Desktop/workspace/powerspike/ps-site",
            "Destination": "/var/www",
            "Mode": "rw",
            "RW": true,
            "Propagation": "rprivate"
        }
    ],
    "Config": {
        "Hostname": "e70c81b301e7",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
            "80/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "DB_TYPE=LOCAL"
        ],
        "Cmd": [
            "/bin/sh",
            "-c",
            "apache2ctl -D FOREGROUND"
        ],
        "ArgsEscaped": true,
        "Image": "site:latest",
        "Volumes": {
            "/var/www": {}
        },
        "WorkingDir": "",
        "Entrypoint": null,
        "OnBuild": null,
        "Labels": {
            "com.docker.compose.config-hash": "b7f33127262c8ae58d224be2b128f9dda96dca29832374ac707d7b0fe9240c47",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "ps-site",
            "com.docker.compose.service": "site",
            "com.docker.compose.version": "1.23.2"
        }
    },
    "NetworkSettings": {
        "Bridge": "",
        "SandboxID": "acdcb5982dd42ec3f091c82160bcaa1340fbb94de1b34167cee5575a0164535a",
        "HairpinMode": false,
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "Ports": {
            "80/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "80"
                }
            ]
        },
        "SandboxKey": "/var/run/docker/netns/acdcb5982dd4",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null,
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "MacAddress": "",
        "Networks": {
            "ps-site_default": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "site",
                    "e70c81b301e7"
                ],
                "NetworkID": "ed87dd99112a9c2729d3688423a23288f08b3bf4edee8cb36e93d3ef3392ec53",
                "EndpointID": "0ea13e0314b2400b30d655cbdb257cfcede484c381f483d66d45b0546c334fa2",
                "Gateway": "172.18.0.1",
                "IPAddress": "172.18.0.2",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "02:42:ac:12:00:02",
                "DriverOpts": null
            }
        }
    }
}

]

I am unable to get to the site from both localhost and the specific IP address. please help. thanks!

Hi

Since you get 500 errors, you must be hitting the container (or something else?)
Maybe its a code error?
what does:

docker logs --tail 100 e70c81b301e7200a54b899e0f3de5997fa1c2f19d131b28d2bdef443131e84b9

output ?