Browse Source

Merge pull request #52 from Barbara-Pitt/config

Dockerize (#33)
pull/40/head
Barbara-Pitt 2 years ago
committed by GitHub
parent
commit
27cfc70a57
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      Dockerfile
  2. 45
      docker-compose.yml
  3. 16
      site.conf

22
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

45
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

16
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;
}
}
Loading…
Cancel
Save