Commit c2d689b5 authored by Ivan Oštrić's avatar Ivan Oštrić

Provide Docker support

parent 06a530a0
......@@ -20,5 +20,5 @@ MAILER_URL=null://localhost
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
DATABASE_URL=mysql://root:[email protected]:3306/test
###< doctrine/doctrine-bundle ###
FROM php:7.2.6-fpm-alpine3.7
# Since we are running on Mac we are not gonna bother with importing user and group IDs from host.
RUN addgroup app && adduser -s /bin/sh -DS -G app app
RUN apk --update add zlib-dev icu-dev
RUN docker-php-ext-install intl opcache pdo_mysql zip
# Download and install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
php -r "unlink('composer-setup.php');"
# copy our app so that we can run it independently of the docker-compose settings
COPY . /app
RUN mkdir -p /app/var/cache /app/vendor
# this is necessary if we want to run our app as the app user
RUN chown app:app -R /app
version: '3.5'
services:
php:
build: .
user: app
working_dir: /app
command: ["php-fpm", "-F"]
volumes:
- .:/app:cached
- cache:/app/var/cache
- vendor:/app/vendor
database:
image: mariadb:10.3
volumes:
- database:/var/lib/mysql
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: test
nginx:
image: nginx:1.14.0-alpine
ports:
- "3001:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- .:/app:cached
- cache:/app/var/cache
- vendor:/app/vendor
depends_on:
- php
volumes:
cache:
vendor:
database:
server {
listen 80;
root /app/public;
client_max_body_size 20m;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_read_timeout 3h;
internal;
}
location ~ \.php$ {
return 404;
}
}
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