Commit 50f5277b authored by Tino Goratsch's avatar Tino Goratsch

add a simple docker/docker-compose dev environment

parent 24940b1d
Pipeline #38568973 (#2573) failed with stages
in 2 minutes and 32 seconds
PHP_VERSION=7.2
MYSQL_VERSION=5.7
APACHE_VERSION=2.4.37
......@@ -2,6 +2,7 @@
/.php_cs
/.php_cs.cache
/ACP3/config.yml
/build/docker/mysql/dump/
/build/logs/
/build/sami/
/cache/*
......
ARG APACHE_VERSION=""
FROM httpd:${APACHE_VERSION:+${APACHE_VERSION}-}alpine
RUN apk update; \
apk upgrade;
RUN echo "IncludeOptional /usr/local/apache2/conf/sites-enabled/*.conf" \
>> /usr/local/apache2/conf/httpd.conf
ServerName localhost
LoadModule expires_module /usr/local/apache2/modules/mod_expires.so
LoadModule rewrite_module /usr/local/apache2/modules/mod_rewrite.so
LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so
<VirtualHost *:80>
# Proxy .php requests to port 9000 of the php-fpm container
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
DocumentRoot /var/www/html/
<Directory /var/www/html/>
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Send apache logs to stdout and stderr
CustomLog /proc/self/fd/1 common
ErrorLog /proc/self/fd/2
</VirtualHost>
ARG PHP_VERSION=""
FROM php:${PHP_VERSION:+${PHP_VERSION}-}fpm
RUN apt-get update -yqq && \
apt-get install git \
zlib1g-dev \
unzip \
libpng-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libicu-dev -yqq && \
(which ssh-agent || (apt-get install openssh-client -y)) && \
docker-php-ext-install -j$(nproc) zip \
intl \
pdo_mysql && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(nproc) gd && \
apt-get autoremove && \
apt-get clean
RUN curl --silent --show-error https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
composer global require hirak/prestissimo
version: "3.7"
services:
php:
build:
context: './build/docker/php/'
args:
PHP_VERSION: ${PHP_VERSION}
depends_on:
- mysql
networks:
- ra-lauck-dev
volumes:
- data-htdocs-acp3-sync:/var/www/html/:nocopy
container_name: php-acp3
environment:
- ACP3_APPLICATION_MODE=dev
apache:
build:
context: './build/docker/apache/'
args:
APACHE_VERSION: ${APACHE_VERSION}
depends_on:
- php
networks:
- ra-lauck-dev
ports:
- "80:80"
volumes:
- ./build/docker/apache/vhost.conf:/usr/local/apache2/conf/sites-enabled/vhost.conf:ro
- data-htdocs-acp3-sync:/var/www/html/:nocopy
container_name: apache-acp3
mysql:
image: mysql:${MYSQL_VERSION:-latest}
networks:
- ra-lauck-dev
volumes:
- data-mysql-acp3:/var/lib/mysql/
- ./build/docker/mysql/dump:/docker-entrypoint-initdb.d
environment:
- MYSQL_DATABASE=acp3
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
container_name: mysql-acp3
volumes:
data-htdocs-acp3-sync:
external: true
data-mysql-acp3:
networks:
ra-lauck-dev:
version: "2"
syncs:
data-htdocs-acp3-sync: # tip: add -sync and you keep consistent names als a convention
sync_args: ['-perms=0'] #required for two way sync ie generators, etc
sync_strategy: 'unison'
sync_host_ip: '127.0.0.1' #host ip isn't properly inferred
sync_excludes: ['.gitignore', '.idea/*','.git/*', 'node_modules/*', '*.scss']
sync_userid: '33'
src: './'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment