Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
30 changes: 30 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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