FROM phpdockerio/php73-fpm
RUN mkdir -p www/
WORKDIR www/
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
php7.3-mysql \
php-xdebug \
php7.3-intl \
php-yaml \
php-curl \
php7.3-gmp \
curl \
nano \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install git
RUN apt-get update \
&& apt-get -y install git \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer --version
# Install dependencies
COPY composer*.json .
RUN composer install
CMD [ "php-fpm7.3", "-F", "--pid", "/var/run/php-fpm7.3.pid" ]
# Php application
app:
container_name: rosinter.app
restart: on-failure
build:
context: .
dockerfile: ./docker/php/Dockerfile-dev
volumes:
- .:/www
- ./docker/php/log:/var/log
depends_on:
- db
links:
- db
expose:
- 9000
docker exec -i rosinter.app php bin/console doctrine:schema:create
version: '3'
services:
backend:
container_name: 'backend'
build: ./src
env_file:
- ./src/.env
volumes:
- ./src:/srv/
- /srv/node_modules/
ports:
+ - 127.0.0.100:3000:3000
depends_on:
- mongo
links:
- mongo
mongo:
image: mongo:latest
container_name: 'mongodb'
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/data/logs
volumes:
- ./data/db:/data/db
ports:
+ - 127.0.0.100:27017:27017
command: mongod --logpath=/dev/null
Лучше если это будут делать скрипты внутри контейнеров.
echo ""
echo "Creating a database schema..."
echo "---------------------------------"
docker exec -i rosinter.app php bin/console doctrine:schema:create
Start-sleep 3
Не понимаю, как я раньше жил без них.