Skip to content

Commit

Permalink
Merge pull request #2 from mwarzybok-sumoheavy/feature/SP-691
Browse files Browse the repository at this point in the history
SP-691 PHP Symfony Demo - Docker Compose
  • Loading branch information
bobbrodie committed Sep 20, 2023
2 parents 11e8fc3 + 587a070 commit 9f07d97
Show file tree
Hide file tree
Showing 12 changed files with 2,763 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ APP_SECRET=496561b8a8428ed654c4405a2414e726
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
DATABASE_URL="sqlite:///%kernel.project_dir%/bitpay.db"
DATABASE_URL="sqlite:///%kernel.project_dir%/bitpay.sqlite"
###< doctrine/doctrine-bundle ###

###> symfony/messenger ###
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

application.yaml
application-functional.yaml
bitpay.sqlite

###> squizlabs/php_codesniffer ###
/.phpcs-cache
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ values.

## Running

- `composer install`
- `add php-kiosk-demo-symfony.test to your OS hosts`
- `cp .env .env.local` and configure it
- `cp application-example.yaml application.yaml` and configure it
- `php doctrine:database:create` to create DB
- `php doctrine:schema:update --force`
- `docker-compose up`

## Testing

Expand Down
63 changes: 63 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: '3.8'

services:
php-fpm:
build:
context: ./docker/php-fpm
working_dir: /usr/local/apache2/htdocs/php-kiosk-symfony
volumes:
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini
- ./:/usr/local/apache2/htdocs/php-kiosk-symfony
expose:
- "9000"
networks:
- bitpay

init:
build:
context: ./docker/php-fpm
working_dir: /usr/local/apache2/htdocs/php-kiosk-symfony
volumes:
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini
- ./:/usr/local/apache2/htdocs/php-kiosk-symfony
networks:
- bitpay
user: "1000:1000"
command: sh -c './init.sh'

apache2:
build:
context: ./docker/apache2
ports:
- "80:80"
volumes:
- ./docker/apache2/sites/default.apache.conf:/usr/local/apache2/conf/extra/default.apache.conf
- ./:/usr/local/apache2/htdocs/php-kiosk-symfony
depends_on:
- php-fpm
networks:
- bitpay
command: ["httpd-foreground"]

mercure:
build:
context: ./docker/mercure
ports:
- "1337:80"
- "1338:443"
privileged: true
environment:
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET}
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET}
DEBUG: debug
SERVER_NAME: :80
ALLOW_ANONYMOUS: 1
MERCURE_EXTRA_DIRECTIVES: |-
cors_origins "http://127.0.0.1" "http://php-kiosk-demo-symfony.test"
anonymous
hostname: bitpay-mercure
networks:
- bitpay

networks:
bitpay:
11 changes: 11 additions & 0 deletions docker/apache2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM httpd:2.4-alpine

ARG PHP_UPSTREAM_CONTAINER=php-fpm
ARG PHP_UPSTREAM_PORT=9000
ENV WEB_PHP_TIMEOUT=60

ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}

COPY httpd.conf /usr/local/apache2/conf/httpd.conf

EXPOSE 80 443
Loading

0 comments on commit 9f07d97

Please sign in to comment.