Skip to content

Commit

Permalink
SP-690 PHP Laravel Demo - Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarzybok-sumoheavy committed Sep 18, 2023
1 parent f9d5035 commit 2dd174d
Show file tree
Hide file tree
Showing 12 changed files with 582 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=/var/www/php-kiosk-demo-laravel/database/bitpay.sqlite
DB_DATABASE=/usr/local/apache2/htdocs/php-kiosk-demo-laravel/database/bitpay.sqlite
DB_USERNAME=root
DB_PASSWORD=

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ values.

- `add php-kiosk-demo-laravel.test to your OS hosts`
- `docker-compose up`
- `composer install` from php-fpm container (docker-compose exec --user=www-data php-fpm bash & cd php-kiosk-demo-laravel)
- `composer install` from php-fpm container (docker-compose exec --user=www-data php-fpm bash)
- `cp .env.example .env` and configure it
- `cp application-example.yaml application.yaml` and configure it
- `php artisan migrate` to run DB migrations (and create sqlite DB if you use this database)
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ services:
php-fpm:
build:
context: ./docker/php-fpm
working_dir: /var/www/html
working_dir: /usr/local/apache2/htdocs/php-kiosk-demo-laravel
volumes:
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini
- ./:/var/www/html/php-kiosk-demo-laravel
- ./:/usr/local/apache2/htdocs/php-kiosk-demo-laravel
expose:
- "9000"
networks:
Expand All @@ -19,13 +19,13 @@ services:
ports:
- "80:80"
volumes:
- ./docker/apache2/sites:/etc/apache2/sites-available
- ./docker/apache2/ssl:/etc/apache2/ssl
- ./:/var/www/html/php-kiosk-demo-laravel
- ./docker/apache2/sites/default.apache.conf:/usr/local/apache2/conf/extra/default.apache.conf
- ./:/usr/local/apache2/htdocs/php-kiosk-demo-laravel
depends_on:
- php-fpm
networks:
- bitpay
command: ["httpd-foreground"]

mercure:
build:
Expand Down
18 changes: 3 additions & 15 deletions docker/apache2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
FROM webdevops/apache:ubuntu-18.04
FROM httpd:2.4-alpine

ARG PHP_UPSTREAM_CONTAINER=php-fpm
ARG PHP_UPSTREAM_PORT=9000

ENV WEB_DOCUMENT_ROOT=/var/www/html/
ENV WEB_PHP_TIMEOUT=60

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

EXPOSE 80 443

WORKDIR /var/www/

COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
COPY httpd.conf /usr/local/apache2/conf/httpd.conf

ADD ./start.sh /opt/start.sh

ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]

CMD ["/bin/bash", "/opt/start.sh"]

EXPOSE 80 443
EXPOSE 80 443
Loading

0 comments on commit 2dd174d

Please sign in to comment.