Created
May 25, 2019 09:40
-
-
Save Ellestad1995/8609dfd512e692d31473063fe6b69fa2 to your computer and use it in GitHub Desktop.
docker-compose setup for php backend, node frontend, mariadb database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.2" | |
services: | |
www: | |
build: | |
context: . | |
dockerfile: ./Dockerfile.www | |
ports: | |
- 8080:8080 | |
volumes: | |
- type: bind | |
source: ./frontend | |
target: /root/app | |
networks: | |
- default | |
api: | |
build: | |
context: . | |
dockerfile: ./Dockerfile.api | |
ports: | |
- 8081:80 | |
volumes: | |
- type: bind | |
source: ./backend/src | |
target: /var/www/html/ | |
- type: bind | |
source: ./logs | |
target: /var/log/apache2/ | |
- type: volume | |
source: schooltube | |
target: /storage | |
environment: | |
#XDEBUG_CONFIG: "remote_host=<hostname>" | |
XDEBUG_CONFIG: remote_host=host.docker.internal #Win/Mac version | |
networks: | |
- default | |
test: | |
build: | |
context: . | |
dockerfile: ./Dockerfile.codeception | |
volumes: | |
- type: bind | |
source: ./test | |
target: /var/www/test | |
- type: bind | |
source: ./backend/src | |
target: /var/www/html | |
networks: | |
- default | |
database: | |
image: mariadb | |
environment: | |
MYSQL_USER: admin | |
MYSQL_PASSWORD: admin | |
MYSQL_ROOT_PASSWORD: password99 | |
volumes: | |
- type: bind | |
source: ./database | |
target: /docker-entrypoint-initdb.d | |
- type: volume | |
source: dbstorage | |
target: /var/lib/mysql | |
networks: | |
- default | |
phpmyadmin: | |
image: phpmyadmin/phpmyadmin | |
ports: | |
- 8082:80 | |
environment: | |
- MYSQL_USER=admin | |
- MYSQL_PASSWORD=admin | |
- MYSQL_ROOT_PASSWORD=password99 | |
- PMA_HOST=database | |
- PMA_PORT=3306 | |
networks: | |
- default | |
selenium-hub: | |
image: selenium/hub:3.141.59-europium | |
container_name: selenium-hub | |
networks: | |
- default | |
ports: | |
- 4444:4444 | |
chrome: | |
image: selenium/node-chrome:3.141.59-europium | |
shm_size: '2gb' | |
depends_on: | |
- selenium-hub | |
environment: | |
- HUB_HOST=selenium-hub | |
- HUB_PORT=4444 | |
- SCREEN_WIDTH=1920 | |
- SCREEN_HEIGHT=1080 | |
firefox: | |
image: selenium/node-firefox:3.141.59-europium | |
shm_size: '2gb' | |
depends_on: | |
- selenium-hub | |
environment: | |
- HUB_HOST=selenium-hub | |
- HUB_PORT=4444 | |
- SCREEN_WIDTH=1920 | |
- SCREEN_HEIGHT=1080 | |
volumes: | |
schooltube: | |
driver: local # is already local by default | |
dbstorage: | |
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Installer image | |
FROM phpstorm/php-71-apache-xdebug:latest | |
#Install composer | |
#COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | |
#COPY ./api/src/composer.json /var/www/composer.json | |
#ENV COMPOSER_ALLOW_SUPERUSER 1 | |
WORKDIR /var/www/ | |
#Install requirements | |
RUN apt-get update -y \ | |
&& apt-get install -y zip git ffmpeg \ | |
&& mkdir -p /storage/video \ | |
&& chown www-data:www-data /storage -R \ | |
&& chmod 770 /storage -R \ | |
&& docker-php-ext-install pdo pdo_mysql \ | |
#&& composer install \ | |
&& echo "upload_max_filesize = 100M" >> "$PHP_INI_DIR/php.ini" \ | |
&& echo "post_max_size = 100M" >> "$PHP_INI_DIR/php.ini" | |
# && echo "upload_tmp_dir = /storage/upload_tmp_dir" >> "$PHP_INI_DIR/php.ini" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from php:7.3-apache | |
RUN docker-php-ext-install pdo_mysql \ | |
&& docker-php-ext-enable pdo_mysql | |
RUN curl -LsS https://codeception.com/codecept.phar -o /usr/local/bin/codecept | |
RUN chmod a+x /usr/local/bin/codecept | |
WORKDIR /var/www/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10-jessie | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends git && \ | |
apt-get clean && \ | |
npm install -g polymer-cli --unsafe-perm && \ | |
npm install --save lit-element | |
EXPOSE 8080 | |
RUN mkdir -p app | |
VOLUME /root/app | |
WORKDIR /root/app | |
CMD [ "polymer", "serve", "-p", "8080", "-H", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment