Skip to content
Permalink
Browse files

Docker compose

  • Loading branch information...
dancryer committed Dec 5, 2018
1 parent 2b89233 commit b5482badf2c957dd6fe1a7df9d86ceb3c4cacf7e
Showing with 116 additions and 21 deletions.
  1. +0 −21 Dockerfile
  2. +38 −0 docker-compose.yaml
  3. +25 −0 docker/fpm-entrypoint.sh
  4. +10 −0 docker/fpm.dockerfile
  5. +20 −0 docker/nginx.conf
  6. +12 −0 docker/worker-entrypoint.sh
  7. +11 −0 docker/worker.dockerfile

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,38 @@
version: '2'
services:
web:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./public/assets:/phpci/public/assets
- ./public/favicon.ico:/phpci/public/favicon.ico
- ./public/robots.txt:/phpci/public/robots.txt
- ./docker/nginx.conf:/etc/nginx/conf.d/phpci.conf
links:
- fpm

worker:
image: phpci-worker
build:
context: .
dockerfile: docker/worker.dockerfile
links:
- beanstalkd
volumes:
- .:/phpci

fpm:
image: phpci-fpm
build:
context: .
dockerfile: docker/fpm.dockerfile
links:
- beanstalkd
volumes:
- .:/phpci

beanstalkd:
image: schickling/beanstalkd:latest
ports:
- "11300:11300"
@@ -0,0 +1,25 @@
#!/bin/sh

cd /phpci

# Install composer:
php -r "readfile('https://getcomposer.org/installer');" | php \
&& mv composer.phar /usr/local/bin/composer

# Install composer dependencies:
composer install -o --no-dev

# Install npm dependencies:
npm install --production

mkdir -p ./public/assets/js/AdminLTE
mkdir -p ./public/assets/plugins

cp -Rf ./node_modules/admin-lte/dist/adminlte.min.js ./public/assets/js/AdminLTE/app.min.js
cp -Rf ./node_modules/admin-lte/dist/pages/dashboard.min.js ./public/assets/js/AdminLTE/dashboard.js
cp -Rf ./node_modules/admin-lte/dist/demo.js ./public/assets/js/AdminLTE/demo.js
cp -Rf ./node_modules/admin-lte/dist/css ./public/assets/css
cp -Rf ./node_modules/admin-lte/dist/img ./public/assets/img
cp -Rf ./node_modules/admin-lte/plugins ./public/assets/plugins

php-fpm
@@ -0,0 +1,10 @@
FROM php:7-fpm
RUN apt update && apt install -qy libcurl3-dev curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
RUN apt update && apt install -qy nodejs
RUN docker-php-ext-install -j$(nproc) pdo_mysql
RUN docker-php-ext-install -j$(nproc) curl

COPY docker/fpm-entrypoint.sh /fpm-entrypoint.sh

ENTRYPOINT ["/bin/bash", "/fpm-entrypoint.sh"]
@@ -0,0 +1,20 @@
server {
listen 80 default_server;

root /phpci/public;

location / {
try_files $uri @phpci;
}

location @phpci {
fastcgi_pass fpm:9000;
fastcgi_index index.php;
fastcgi_buffers 256 4k;
include fastcgi_params;

fastcgi_param SCRIPT_FILENAME /phpci/public/index.php;
fastcgi_param REQUEST_URI $uri;
fastcgi_param PATH_INFO $uri;
}
}
@@ -0,0 +1,12 @@
#!/bin/sh

cd /phpci

# Install composer:
php -r "readfile('https://getcomposer.org/installer');" | php \
&& mv composer.phar /usr/local/bin/composer

# Install composer dependencies:
composer install -o --no-dev

php /phpci/console phpci:worker
@@ -0,0 +1,11 @@
FROM php:7
RUN apt update && apt install -qy git-core libcurl3-dev curl
RUN docker-php-ext-install -j$(nproc) pdo_mysql
RUN docker-php-ext-install -j$(nproc) curl

RUN git config --global user.name "PHPCI" \
&& git config --global user.email "hello@phptesting.org"

COPY docker/worker-entrypoint.sh /worker-entrypoint.sh

ENTRYPOINT ["/bin/bash", "/worker-entrypoint.sh"]

0 comments on commit b5482ba

Please sign in to comment.
You can’t perform that action at this time.