diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8a50c0f65 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +FROM php:7.4-fpm + +RUN apt-get update && apt-get install -y \ + libxml2-dev \ + libicu-dev \ + libcurl3-dev \ + libsqlite3-dev \ + libedit-dev \ + zlib1g-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmemcached-dev \ + libzip-dev \ + libonig-dev \ + libpq-dev +RUN docker-php-ext-install \ + intl \ + pdo_mysql \ + pdo_pgsql \ + opcache \ + bcmath \ + soap \ + sockets \ + zip \ + && docker-php-ext-configure gd \ + && docker-php-ext-install -j$(nproc) gd + +RUN pecl install apcu \ + && pecl install apcu_bc \ + && docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini \ + && docker-php-ext-enable apc --ini-name 20-docker-php-ext-apc.ini + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +RUN curl -sS https://get.symfony.com/cli/installer | bash -s -- "--install-dir=/usr/local/bin" + +RUN apt-get update && apt-get install -y \ + openssh-client \ + git \ + gnupg \ + apt-transport-https + +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash +RUN apt-get install -y nodejs +RUN mkdir /.npm && chown -R 1000:1000 "/.npm" + +WORKDIR /var/www/xtools + +CMD ["php-fpm"] diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 000000000..b95e9cfae --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,30 @@ +version: "3.8" +services: + traefik: + image: traefik:v2.5 + command: + - --providers.docker + - --entryPoints.web.address=:80 + - --entryPoints.websecure.address=:443 + ports: + - "80:80" + - "443:443" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + + adminer: + image: adminer + labels: + - traefik.enable=true + - traefik.http.routers.adminer.rule=Host(`adminer.localhost`) + - traefik.http.routers.adminer.entryPoints=web + depends_on: + - mariadb + + php: + labels: + - traefik.enable=true + - traefik.http.routers.app.rule=Host(`xtools.localhost`) + - traefik.http.routers.app.entryPoints=web + volumes: + - .:/var/www/xtools diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..c7ea352ab --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.8" +services: + mariadb: + hostname: mariadb + image: mariadb + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: xtools + + php: + user: ${UID:-1000}:${GID:-1000} + hostname: php8.2-fpm + build: . + ports: + - "8000:80" + depends_on: + - mariadb