Can’t turn SSL on a docker’s nginx container

I’m new to docker and try to build an image based on Alpine to take care of my websites with HTTPS connexions. Currently i’m at the step to make it work from the container so i’m not finished yet with my Dockerfile my Dockerfile :

FROM alpine   RUN apk update \         && apk upgrade \         && apk add nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl \         && mkdir /run/nginx EXPOSE 80 

From there i start my container :

docker run -ti -p 80:80 -p 443:442 -v /home/docker/web/conf:/etc/nginx/conf.d/ -v /home/docker/web/www:/var/www/localhost/htdocs test 

I then install certbot-nginx, and start it to generate my certificate, which i copy in my /var/www/localhost/htdocs/ to access it from outside the container. Finally i start php-fpm7 & nginx.

My nginx config :

server {         server_name;         root /var/www/localhost/htdocs/;         index index.html index.htm index.php;         listen [::]:443 ssl;         server_tokens off;         # configure php         location ~ \.php$   {                 fastcgi_pass;                 fastcgi_index index.php;                 include fastcgi.conf;                 index index.html index.htm index.php;         }          location ~* \.pem {                 deny all;         }          ssl_certificate /var/www/localhost/htdocs/;          ssl_certificate_key /var/www/localhost/htdocs/; # managed by Certbot  }  server {     if ($  host = {         return 301 https://$  host$  request_uri;     }        # managed by Certbot        server_name;        listen 80;        listen [::]:80;        #return 404; } 

I’m probably missing something simple but i’m stuck since a week. thanks !

php_network_getaddresses: getaddrinfo failed error in Docker’s adminer


I have problem with access to adminer in my docker container with laravel 5/mysql app. I got error :

 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed 
Code (markup):

In my docker-compose.yml :

 version: '3'  services:  votes_app: build: context: ./web dockerfile: Dockerfile.yml  container_name: votes_app_container environment: - APACHE_RUN_USER=#1000 volumes: - $  {APP_PATH_HOST}:$  {APP_PTH_CONTAINER} ports: - 8081:80 working_dir: $  {APP_PTH_CONTAINER}   db:...
Code (markup):

php_network_getaddresses: getaddrinfo failed error in Docker's adminer