Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add phpcensor worker image. Separate worker and web part
- Loading branch information
Showing
7 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM php:7.0.15-alpine | ||
|
||
MAINTAINER Alexey Boyko <ket4yiit@gmail.com> | ||
|
||
ENV PHPCENSOR_VERSION=0.7.0 | ||
|
||
WORKDIR /var/www/html | ||
|
||
RUN apk update && \ | ||
apk add git openssh postgresql-dev gettext && \ | ||
curl -sS https://getcomposer.org/installer | php && \ | ||
mv composer.phar /usr/bin/composer | ||
|
||
RUN docker-php-ext-install -j$(grep -c ^processor /proc/cpuinfo) pdo pdo_mysql pdo_pgsql | ||
|
||
RUN git clone https://github.com/corpsee/php-censor.git . | ||
RUN composer install | ||
|
||
ADD entrypoint.sh / | ||
ADD config.tmpl.yml / | ||
|
||
ENV DB_HOST=localhost | ||
ENV DB_TYPE=mysql | ||
ENV DB_NAME=phpcensor | ||
ENV DB_USER=phpcensor | ||
ENV DB_PASS=changethepass | ||
ENV BEANSTALK_HOST=beanstalk | ||
ENV BEANSTALK_QUEUE_NAME=phpcensor | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
b8: | ||
database: | ||
servers: | ||
read: | ||
- host: $LOCAL_DB_HOST | ||
port: $LOCAL_DB_PORT | ||
write: | ||
- host: $LOCAL_DB_HOST | ||
port: $LOCAL_DB_PORT | ||
type: $DB_TYPE | ||
name: $DB_NAME | ||
username: $DB_USER | ||
password: $DB_PASS | ||
php-censor: | ||
language: en | ||
per_page: 10 | ||
url: '$SITE_URL' | ||
email_settings: | ||
from_address: $SMTP_FROM | ||
smtp_address: $SMTP_HOST | ||
smtp_port: $SMTP_PORT | ||
smtp_username: $SMTP_USER | ||
smtp_password: $SMTP_PASSWORD | ||
default_mailto_address: $SMTP_DEFAULTTO | ||
smtp_encryption: $SMTP_ENCRYPT | ||
queue: | ||
host: $BEANSTALK_HOST | ||
name: $BEANSTALK_QUEUE_NAME | ||
lifetime: 600 | ||
github: | ||
token: $GITHUB_TOKEN | ||
comments: | ||
commit: false | ||
pull_request: false | ||
build: | ||
remove_builds: true | ||
security: | ||
disable_auth: false | ||
default_user_id: 1 | ||
auth_providers: | ||
internal: | ||
type: internal | ||
ldap: | ||
type: ldap | ||
data: | ||
host: $LDAP_HOST | ||
port: $LDAP_PORT | ||
base_dn: $LDAP_BASE_DN | ||
mail_attribute: $LDAP_MAIL_ATTRIBUTE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -eo pipefail | ||
|
||
export LOCAL_DB_HOST=$(echo $DB_HOST | awk -F ":" '{ print $1 }') | ||
export LOCAL_DB_PORT=$(echo $DB_HOST | awk -F ":" '{ print $2; }') | ||
|
||
[ ! -f ./app/config.yml ] && envsubst < /config.tmpl.yml > ./app/config.yml | ||
./bin/console php-censor:worker |