Adding experimental Dockerfile with RoadRunner.
This commit is contained in:
parent
5bf62f362e
commit
181d449f37
43
.dockerignore
Normal file
43
.dockerignore
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
### Symfony template
|
||||||
|
# Cache and logs (Symfony2)
|
||||||
|
/app/cache/*
|
||||||
|
/app/logs/*
|
||||||
|
!app/cache/.gitkeep
|
||||||
|
!app/logs/.gitkeep
|
||||||
|
|
||||||
|
# Email spool folder
|
||||||
|
/app/spool/*
|
||||||
|
|
||||||
|
# Cache, session files and logs (Symfony3)
|
||||||
|
/var/cache/*
|
||||||
|
/var/sessions/*
|
||||||
|
!var/cache/.gitkeep
|
||||||
|
!var/sessions/.gitkeep
|
||||||
|
|
||||||
|
# Logs (Symfony4)
|
||||||
|
/var/log/*
|
||||||
|
!var/log/.gitkeep
|
||||||
|
|
||||||
|
# Managed by Composer
|
||||||
|
/app/bootstrap.php.cache
|
||||||
|
/var/bootstrap.php.cache
|
||||||
|
/bin/*
|
||||||
|
!bin/console
|
||||||
|
!bin/symfony_requirements
|
||||||
|
/vendor/
|
||||||
|
|
||||||
|
# PHPUnit
|
||||||
|
/app/phpunit.xml
|
||||||
|
/phpunit.xml
|
||||||
|
|
||||||
|
# Composer PHAR
|
||||||
|
/composer.phar
|
||||||
|
|
||||||
|
# Backup entities generated with doctrine:generate:entities command
|
||||||
|
**/Entity/*~
|
||||||
|
|
||||||
|
# Embedded web-server pid file
|
||||||
|
/.web-server-pid
|
||||||
|
|
||||||
|
# DotEnv
|
||||||
|
.env.local
|
2
.env
2
.env
|
@ -3,7 +3,7 @@
|
||||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
APP_ENV=dev
|
APP_ENV=prod
|
||||||
APP_SECRET=xxx
|
APP_SECRET=xxx
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,17 +1,39 @@
|
||||||
FROM php:8.1-fpm-alpine
|
# https://github.com/roadrunner-server/roadrunner/pkgs/container/roadrunner
|
||||||
|
FROM ghcr.io/roadrunner-server/roadrunner:latest AS roadrunner
|
||||||
|
FROM php:8.1-alpine
|
||||||
|
|
||||||
ENV PHP_TIMEZONE Europe/Moscow
|
ENV PHP_TIMEZONE Europe/Moscow
|
||||||
|
ENV APP_ENV=prod
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=roadrunner /usr/bin/rr /app/bin/rr
|
||||||
|
COPY . /app/
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add postgresql-dev libpq && \
|
apk add autoconf build-base icu libpq postgresql-dev && \
|
||||||
docker-php-ext-configure igbinary && \
|
|
||||||
docker-php-ext-configure intl && \
|
docker-php-ext-configure intl && \
|
||||||
docker-php-ext-configure pdo_pgsql && \
|
docker-php-ext-configure pdo_pgsql && \
|
||||||
docker-php-ext-install -j$(nproc) igbinary && \
|
docker-php-ext-configure sockets && \
|
||||||
docker-php-ext-install -j$(nproc) instl && \
|
docker-php-ext-install -j$(nproc) intl && \
|
||||||
docker-php-ext-install -j$(nproc) pdo_pgsql && \
|
docker-php-ext-install -j$(nproc) pdo_pgsql && \
|
||||||
|
docker-php-ext-install -j$(nproc) sockets && \
|
||||||
|
#pecl install igbinary-3.2.7 && \
|
||||||
pecl install redis-5.3.7 && \
|
pecl install redis-5.3.7 && \
|
||||||
|
#docker-php-ext-enable igbinary && \
|
||||||
|
docker-php-ext-enable intl && \
|
||||||
|
docker-php-ext-enable pdo_pgsql && \
|
||||||
docker-php-ext-enable redis && \
|
docker-php-ext-enable redis && \
|
||||||
apk del postgresql-dev && \
|
apk del autoconf build-base postgresql-dev && \
|
||||||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
echo "date.timezone = $PHP_TIMEZONE" > $PHP_INI_DIR/conf.d/timezone.ini
|
echo "date.timezone = $PHP_TIMEZONE" > $PHP_INI_DIR/conf.d/timezone.ini && \
|
||||||
|
mkdir -p /usr/local/bin && \
|
||||||
|
wget -O /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar && \
|
||||||
|
chmod +x /usr/local/bin/composer && \
|
||||||
|
ls -la /app && ls -la /app/bin && \
|
||||||
|
chmod +x /app/bin/console && \
|
||||||
|
/usr/local/bin/composer install --no-dev --no-progress --no-interaction --optimize-autoloader
|
||||||
|
|
||||||
|
VOLUME /var/log
|
||||||
|
|
||||||
|
CMD ["/app/bin/rr", "serve"]
|
||||||
|
|
21
README.md
21
README.md
|
@ -91,3 +91,24 @@ php bin/console user:add <your_username> <your_email> [your_password] [--invites
|
||||||
# see --help for more info
|
# see --help for more info
|
||||||
php bin/console invite:add <username> <number-of-invites>
|
php bin/console invite:add <username> <number-of-invites>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Enabling dev mode
|
||||||
|
|
||||||
|
```shell
|
||||||
|
echo 'APP_ENV=dev > .env.local'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running in [RoadRunner](https://roadrunner.dev)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# First time only:
|
||||||
|
./vendor/bin/rr get --location bin/
|
||||||
|
|
||||||
|
# Running the server:
|
||||||
|
./bin/rr serve
|
||||||
|
|
||||||
|
# Running the server in dev mode (watching enabled)
|
||||||
|
bin/rr serve -c .rr.dev.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
Read more [here](https://github.com/baldinof/roadrunner-bundle) and [here](https://github.com/roadrunner-server/roadrunner).
|
||||||
|
|
|
@ -2,16 +2,19 @@ version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
magnetico-web:
|
magnetico-web:
|
||||||
image: skobkin/magnetico-web-fpm
|
image: skobkin/magnetico-web
|
||||||
build:
|
build:
|
||||||
context: ./docker
|
context: .
|
||||||
container_name: magnetico-web-fpm
|
container_name: magnetico-web
|
||||||
network_mode: host
|
hostname: magnetico-web
|
||||||
|
extra_hosts:
|
||||||
|
- 'host.docker.internal:host-gateway'
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:${PHP_FPM_PORT:-9000}:9000/tcp"
|
- "127.0.0.1:${EXT_HTTP_PORT:-8080}:8080/tcp"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
user: "$UID"
|
||||||
volumes:
|
volumes:
|
||||||
- "${APP_LOCAL_PATH}:${APP_LOCAL_PATH}"
|
- "${LOG_PATH:-./var/log}:/app/var/log"
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
|
|
Loading…
Reference in a new issue