From 8c1c680ea07aaf42b9987898d252e33243e77894 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 17:15:12 -0600 Subject: [PATCH] adding docker items --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ site.conf | 16 ++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 site.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c568280f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM php:5.6-fpm +RUN docker-php-ext-install pdo pdo_mysql +RUN apt-get update -y && apt-get install -y libpng-dev libjpeg-dev +RUN docker-php-ext-install mbstring +RUN apt-get update -y && apt-get install -y libmcrypt-dev +RUN docker-php-ext-install -j$(nproc) mcrypt +RUN docker-php-ext-install iconv +RUN apt-get update -y && apt-get install -y imagemagick +RUN apt-get update -y && apt-get install -y graphicsmagick +RUN apt-get update -y && apt-get install -y gifsicle +RUN docker-php-ext-configure gd \ + --with-png-dir=/usr \ + --with-jpeg-dir=/usr +RUN docker-php-ext-install gd +RUN apt-get update -y \ + && apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ + && pecl install memcached-2.2.0 \ + && echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini \ + && apt-get remove -y build-essential libmemcached-dev libz-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/pear \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..3d61f915 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +services: + #nginx webserver + php 5.6 + web: + image: nginx:1.19.6-alpine + ports: + - "8080:80" + depends_on: + - db + volumes: + - ./:/code + - ./site.conf:/etc/nginx/conf.d/default.conf + networks: + leftchan_net: + ipv4_address: 172.20.0.3 + links: + - php + php: + build: . + volumes: + - ./:/code + networks: + leftchan_net: + ipv4_address: 172.20.0.4 + #MySQL Service + db: + image: mysql:5.6.50 + container_name: db + restart: unless-stopped + tty: true + ports: + - "3306:3306" + environment: + MYSQL_DATABASE: lainchan + MYSQL_ROOT_PASSWORD: M9q5lO0RxJVh + networks: + leftchan_net: + ipv4_address: 172.20.0.2 + +#Docker Networks +networks: + leftchan_net: + ipam: + driver: default + config: + - subnet: 172.20.0.0/16 \ No newline at end of file diff --git a/site.conf b/site.conf new file mode 100644 index 00000000..80bc50fb --- /dev/null +++ b/site.conf @@ -0,0 +1,16 @@ +server { + index index.php index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /code; + + 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; + } +} \ No newline at end of file