ドッカーン

This commit is contained in:
shibafu 2018-06-05 23:45:29 +09:00
parent 503e8ba093
commit d143dc4d84
3 changed files with 56 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.idea
.git
.gitignore
.gitattributes

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM php:7.1-apache
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN apt-get update \
&& apt-get install -y libpq-dev \
&& docker-php-ext-install pdo_pgsql \
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \
&& a2enmod rewrite
WORKDIR /var/www/html

38
docker-compose.yml Normal file
View File

@ -0,0 +1,38 @@
version: "3"
services:
web:
build: .
environment:
DB_CONNECTION: pgsql
DB_HOST: db
DB_PORT: 5432
DB_DATABASE: tissue
DB_USERNAME: tissue
DB_PASSWORD: tissue
volumes:
- .:/var/www/html
networks:
- backend
ports:
- 4545:80
restart: always
depends_on:
- db
db:
image: postgres:10-alpine
environment:
POSTGRES_DB: tissue
POSTGRES_USER: tissue
POSTGRES_PASSWORD: tissue
volumes:
- db:/var/lib/postgresql/data
networks:
- backend
restart: always
networks:
backend:
volumes:
db: