Apuntes de Kirby
  • 馃憖whoami
  • 馃Redes
    • Introducci贸n Redes
      • Organizaciones
      • Historia
      • Puntos de conexi贸n
      • M茅todos de acceso a la red
    • Clasificaci贸n de las redes
    • Topolog铆a de las red
    • Direccionamiento IP
      • IPv4
        • Subredes IPv4
        • Superredes IPv4
        • VLSM
      • IPv6
      • MAC
      • NAT
    • Enrutamiento est谩tico
    • Enrutamiento din谩mico
      • RIPv1 & RIPv2
      • Tablas de enrutamiento
      • 馃毀Redes conmutadas
    • CML
      • 馃毀1er CML lab
    • CISCO
      • 驴Qu茅 son las VLAN?
        • Ejemplo 1 de VLAN
        • Ejemplo 2 de VLAN
      • Acceso y password
      • NAT / PAT
    • Firewalls
      • Tipos de firewalls
      • ZPF
        • Funcionamiento
        • Configurando un ZPF
      • Sophos Firewall XG
        • Sophos home
        • Aprendiendo a usar Sophos
      • pfSense
        • Instalando pfSense
        • OpenVPN en pfSense
        • Port Forward
        • Alias
    • Proxy
      • Squid en pfSense
        • Squid Proxy Server
        • SquidGuard Proxy
      • Proxy reverse Nginx
    • 馃毀Suricata
  • 馃悵Servicios
    • Servidores Web
      • Nginx
        • NGINX, hosts virtuales
        • Hosts virtuales basados en dominio
        • PHP-FPM
        • Nginx: PHP y MySQL
          • MySQLi - PHP
        • En Alpine linux
        • 馃毀Proxy
    • Servidores de correo
      • Seguridad en el correo
      • Postfix
      • hMailServer
      • Clientes de correo
        • Mailutils
        • Mutt
    • Servidores de FTP
      • FileZilla
      • VSFTPD
      • FTP v铆a IIS
    • Servidores DNS
      • DNS - Windows Server 2016
      • DNS - Ubuntu Server 22.04
      • Systemd
    • Servidores DHCP
      • DHCP-Windows Server 2016
      • DHCP-Ubuntu Server 22.04
    • Servidores MySQL
    • 馃毀Mensajer铆a instant谩nea
      • Ejabberd
    • 馃毀Im谩genes - V铆deos
      • FFMPEG + YT-DLP
      • Plex
      • Jellyfin
      • Plesk
      • RTMP
      • SRT
    • Webmin + Virtualmin
  • NextCloud
  • 馃攽Seguridad
    • NAS
      • Instalaci贸n Synology NAS en VirtualBox
        • Creaci贸n de vol煤menes y su uso
        • Actualizaci贸n Synology NAS
        • Creaci贸n de usuarios y carpetas compartidas
        • Funciones del panel de control
          • Acceso por SSH
          • Configuraci贸n de los servicios de archivos
          • Configuraci贸n de red
          • Copias de seguridad (restauraci贸n)
          • Seguridad
          • Personalizar p谩ginas de inicio
          • Servicio de notificaciones
        • Centro de paquetes Synology
          • Servidores multimedia
          • Paquetes de utilidades
          • Cloud Sync
          • Hyper Backup
          • Synology Office
      • Truenas
        • Rsync en Truenas
      • OpenmediaVault
    • Backups
      • Rsync
        • Ejemplo de rsync
    • 驴Qu茅 son las ACL?
    • SOPS/AGE
    • RAID
      • mdadm
  • 馃惓Virtualizaci贸n
    • Proxmox
      • Instalar en VMWare
      • Instalar en VirtualBox
      • Entorno Proxmox
      • Almacenamiento local
      • A帽adir discos
      • Clonar
      • Qemu agent
      • Linux container - LXC
      • Cl煤ster
      • Red Interna
      • 馃毀Proxmox Backup
      • 馃毀Otras consideraciones
    • Alpine Linux
    • Contenedores
      • Docker
        • YAML
        • Instalando Docker
        • Portainer
          • Instalando Portainer
          • Dentro de Portainer
        • Docker volumen
        • Docker compose
          • Docker: PHP y MySQL
          • Importar sitio web en Docker
          • Instalando Wordpress
      • Pi-hole
        • Instalando Pi-hole en Docker
        • Instalando Pi-hole en Debian
        • RDP
          • RDP - Docker
  • 馃悶Miscel谩neas
    • Datos - codificaci贸n
    • IPTables
    • T煤nel con Cloudflare
    • Servidor de video
    • Comandos de Linux
    • Anaconda & Spyder
    • CGI - NGINX
    • Arduino
      • Cap铆tulo 0 Blink
      • Cap铆tulo 1 Led
      • Cap铆tulo 2 Botton & LED
  • 鈦夛笍Interesante
    • Curioso
    • Ideas
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Virtualizaci贸n
  2. Contenedores
  3. Docker
  4. Docker compose

Importar sitio web en Docker

PreviousDocker: PHP y MySQLNextInstalando Wordpress

Last updated 4 months ago

Was this helpful?

Directorio de trabajo

default.conf

server {
    listen 80;
    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;

    ## define root path
    root /var/www/punky;

    ## define location php
    location ~ \.php$ {
        try_files $uri =404;

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass phpfpm:9000;
        fastcgi_index index.php;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

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

docker-compose.yml

 archivo docker-compose.yml

services:
  # PHP service
  phpfpm:
    image: php:8-fpm-alpine
    container_name: phpfpm
    working_dir: /var/www/punky
    ports:
      - "9000:9000"
    volumes:
      - './web:/var/www/punky'
      #- './phpfpm/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf'
    restart: always
    networks:
      - netweb

  # Nginx service
  nginx:
    image: nginx:alpine
    container_name: nginx
    ports:
      - 8082:80
    working_dir: /etc/nginx
    volumes:
      - './web:/var/www/punky'
      - './nginx/default.conf:/etc/nginx/conf.d/default.conf'
      - './nginx/:/var/log/nginx/'
    restart: always
    networks:
    - netweb


  # MySQL database service
  db:
    image: mysql
    container_name: miDB
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: 1234
    volumes:
      - './mysql:/var/lib/mysql'
      - './db:/db'
    networks:
      - netweb

  # PHPMYADMIN
  phpmyadmin:
    image: phpmyadmin
    container_name: miphpmyadmin
    environment:
      PMA_ARBITRARY: 1
    ports:
      - 81:80
    networks:
      - netweb
      
networks:
  netweb:
     driver: bridge

En conexi贸n.php

$servername="db";
$username="root";
$password="1234";
$database="users"; 

馃惓