Browse Source

docker-compose, basic scripts.

pull/31/head
Dominik Schwind 6 years ago
parent
commit
d41d7f4f5a
6 changed files with 111 additions and 0 deletions
  1. +35
    -0
      docker-compose.yml
  2. +8
    -0
      docker/apache/000-default.conf
  3. +26
    -0
      docker/apache/Dockerfile
  4. +14
    -0
      docker/build.sh
  5. +14
    -0
      docker/down.sh
  6. +14
    -0
      docker/start.sh

+ 35
- 0
docker-compose.yml View File

@ -0,0 +1,35 @@
version: '3'
services:
webserver:
build: ./docker/apache
restart: unless-stopped
depends_on:
- db
volumes:
- .:/var/www/html:cached
ports:
- ${portWebserver}:80
db:
image: mysql:5.7
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
- ./docker/tmp:/tmp
- ./docker/database:/docker-entrypoint-initdb.d/
ports:
- ${portDatabase}:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ${dbName}
MYSQL_USER: ${dbUser}
MYSQL_PASSWORD: ${dbPassword}
redis:
image: redis:5
restart: unless-stopped
volumes:
- redis_data:/data
volumes:
db_data:
redis_data:

+ 8
- 0
docker/apache/000-default.conf View File

@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/var/www/html/compass/public"
<Directory "/var/www/html/compass/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

+ 26
- 0
docker/apache/Dockerfile View File

@ -0,0 +1,26 @@
FROM php:7.1-apache-jessie
RUN apt-get update --fix-missing
RUN apt-get -y install sudo &&\
apt-get -y install curl &&\
apt-get -y install git &&\
apt-get -y install zip unzip &&\
apt-get -y install vim && \
apt-get -y install libicu-dev
RUN docker-php-ext-configure intl
RUN docker-php-ext-install pdo pdo_mysql mysqli intl
RUN curl -sS https://getcomposer.org/installer | php && chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
RUN a2enmod rewrite
RUN echo "ServerName compass" | sudo tee /etc/apache2/conf-available/servername.conf && a2enconf servername
COPY ./000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN apachectl graceful

+ 14
- 0
docker/build.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} build

+ 14
- 0
docker/down.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} down

+ 14
- 0
docker/start.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} up -d

Loading…
Cancel
Save