Answer the question
In order to leave comments, you need to log in
Why does docker on wsl start but localhost:8080 doesn't respond?
Installed docker on wsl, because I work with windows all the time. Added my config:
version: "3.1"
services:
mysql:
image: mysql:8.0
container_name: my-mysql
working_dir: /app
volumes:
- .:/app
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=sm
- MYSQL_USER=sly
- MYSQL_PASSWORD=secret
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: my-webserver
working_dir: /app
volumes:
- .:/app
- ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: docker/php-fpm
container_name: my-php-fpm
working_dir: /app
volumes:
- .:/app
- ./docker/php-fpm/php-ini-overrides.ini:/etc/php/7.4/fpm/conf.d/99-overrides.ini
server {
listen 80 default;
client_max_body_size 108M;
access_log /var/log/nginx/app.access.log;
error_log /var/log/nginx/app.error.log;
root /app/public;
index index.php;
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}
location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/app_php_errors.log";
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
include fastcgi_params;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question