Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Commit 85e148a

Browse files
committed
Add Dockerfile && docker-compose.yml
1 parent eb753e0 commit 85e148a

4 files changed

Lines changed: 181 additions & 0 deletions

File tree

.env.dev

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# This file is a "template" of which env vars need to be defined for your application
2+
# Copy this file to .env file for development, create environment variables when deploying to production
3+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
5+
###> symfony/framework-bundle ###
6+
APP_ENV=dev
7+
APP_SECRET=ThisTokenIsNotSoSecretChangeIt
8+
#TRUSTED_PROXIES=
9+
#TRUSTED_HOSTS=
10+
###< symfony/framework-bundle ###
11+
12+
DATABASE_HOST=mariadb
13+
DATABASE_PORT=3306
14+
DATABASE_NAME=xtools
15+
DATABASE_USER=root
16+
DATABASE_PASSWORD=xtools
17+
18+
DATABASE_REPLICA_USER=
19+
DATABASE_REPLICA_PASSWORD=
20+
DATABASE_REPLICA_HOST_S1=127.0.0.1
21+
DATABASE_REPLICA_PORT_S1=3306
22+
DATABASE_REPLICA_HOST_S2=127.0.0.1
23+
DATABASE_REPLICA_PORT_S2=3306
24+
DATABASE_REPLICA_HOST_S3=127.0.0.1
25+
DATABASE_REPLICA_PORT_S3=3306
26+
DATABASE_REPLICA_HOST_S4=127.0.0.1
27+
DATABASE_REPLICA_PORT_S4=3306
28+
DATABASE_REPLICA_HOST_S5=127.0.0.1
29+
DATABASE_REPLICA_PORT_S5=3306
30+
DATABASE_REPLICA_HOST_S6=127.0.0.1
31+
DATABASE_REPLICA_PORT_S6=3306
32+
DATABASE_REPLICA_HOST_S7=127.0.0.1
33+
DATABASE_REPLICA_PORT_S7=3306
34+
DATABASE_REPLICA_HOST_S8=127.0.0.1
35+
DATABASE_REPLICA_PORT_S8=3306
36+
37+
DATABASE_TOOLSDB_HOST=127.0.0.1
38+
DATABASE_TOOLSDB_PORT=
39+
40+
WIKI_URL=https://en.wikipedia.org
41+
API_PATH=/w/api.php
42+
DEFAULT_PROJECT=en.wikipedia.org
43+
CENTRAL_AUTH_PROJECT=meta.wikimedia.org
44+
OPTED_IN="enwiki,newiki"
45+
46+
APP_NOTICE_DISPLAY=0
47+
APP_NOTICE_STYLE=
48+
APP_NOTICE_TEXT=
49+
50+
APP_SINGLE_WIKI=0
51+
APP_IS_WMF=1
52+
APP_REPLAG_THRESHOLD=30
53+
APP_RATE_LIMIT_TIME=0
54+
APP_RATE_LIMIT_COUNT=0
55+
APP_QUERY_TIMEOUT=900
56+
APP_MAX_PAGE_REVISIONS=50000
57+
APP_MAX_USER_EDITS=350000
58+
APP_MULTILINGUAL_WIKIS=
59+
APP_ENABLE_ADMINSCORE=1
60+
APP_ENABLE_ADMINSTATS=1
61+
APP_ENABLE_ARTICLEINFO=1
62+
APP_ENABLE_AUTHORSHIP=1
63+
APP_ENABLE_AUTOEDITS=1
64+
APP_ENABLE_BLAME=1
65+
APP_ENABLE_CATEGORYEDITS=1
66+
APP_ENABLE_EDITCOUNTER=1
67+
APP_ENABLE_EDITSUMMARY=1
68+
APP_ENABLE_GLOBALCONTRIBS=1
69+
APP_ENABLE_LARGESTPAGES=1
70+
APP_ENABLE_META=1
71+
APP_ENABLE_PAGES=1
72+
APP_ENABLE_QUOTE=0
73+
APP_ENABLE_RFXANALYSIS=0
74+
APP_ENABLE_RFXVOTECALCULATOR=0
75+
APP_ENABLE_SIMPLEEDITCOUNTER=1
76+
APP_ENABLE_TOPEDITS=1
77+
78+
# Oauth consumer credentials, from https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration
79+
OAUTH_KEY=
80+
OAUTH_SECRET=
81+
82+
###> symfony/mailer-bundle ###
83+
MAILER_DSN=null://localhost
84+
MAILER_FROM_EMAIL=tools.xtools@tools.wmflabs.org
85+
MAILER_TO_EMAIL=
86+
###< symfony/mailer-bundle ###

Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM php:7.4-fpm
2+
3+
RUN apt-get update && apt-get install -y \
4+
libxml2-dev \
5+
libicu-dev \
6+
libcurl3-dev \
7+
libsqlite3-dev \
8+
libedit-dev \
9+
zlib1g-dev \
10+
libfreetype6-dev \
11+
libjpeg62-turbo-dev \
12+
libmemcached-dev \
13+
libzip-dev \
14+
libonig-dev \
15+
libpq-dev
16+
RUN docker-php-ext-install \
17+
intl \
18+
pdo_mysql \
19+
pdo_pgsql \
20+
opcache \
21+
bcmath \
22+
soap \
23+
sockets \
24+
zip \
25+
&& docker-php-ext-configure gd \
26+
&& docker-php-ext-install -j$(nproc) gd
27+
28+
RUN pecl install apcu \
29+
&& pecl install apcu_bc \
30+
&& docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini \
31+
&& docker-php-ext-enable apc --ini-name 20-docker-php-ext-apc.ini
32+
33+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
34+
RUN curl -sS https://get.symfony.com/cli/installer | bash -s -- "--install-dir=/usr/local/bin"
35+
36+
RUN apt-get update && apt-get install -y \
37+
openssh-client \
38+
git \
39+
gnupg \
40+
apt-transport-https
41+
42+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
43+
RUN apt-get install -y nodejs
44+
45+
WORKDIR /var/www/xtools
46+
47+
CMD ["php-fpm"]

docker-compose.override.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: "3.8"
2+
services:
3+
traefik:
4+
image: traefik:v2.5
5+
command:
6+
- --providers.docker
7+
- --entryPoints.web.address=:80
8+
- --entryPoints.websecure.address=:443
9+
ports:
10+
- "80:80"
11+
- "443:443"
12+
volumes:
13+
- /var/run/docker.sock:/var/run/docker.sock
14+
15+
adminer:
16+
image: adminer
17+
labels:
18+
- traefik.enable=true
19+
- traefik.http.routers.adminer.rule=Host(`adminer.localhost`)
20+
- traefik.http.routers.adminer.entryPoints=web
21+
depends_on:
22+
- mariadb
23+
24+
php:
25+
labels:
26+
- traefik.enable=true
27+
- traefik.http.routers.app.rule=Host(`xtools.localhost`)
28+
- traefik.http.routers.app.entryPoints=web
29+
volumes:
30+
- .:/var/www/xtools

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3.8"
2+
services:
3+
mariadb:
4+
hostname: mariadb
5+
image: mariadb
6+
ports:
7+
- "3306:3306"
8+
environment:
9+
MYSQL_ROOT_PASSWORD: xtools
10+
11+
php:
12+
user: ${UID:-1000}:${GID:-1000}
13+
hostname: php8.2-fpm
14+
build: .
15+
ports:
16+
- "8000:80"
17+
depends_on:
18+
- mariadb

0 commit comments

Comments
 (0)