Skip to content

Commit

Permalink
Created varnish, updated docker compose to start testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryangr0 committed May 4, 2024
1 parent fa26c2f commit 2bffa6a
Show file tree
Hide file tree
Showing 3 changed files with 230 additions and 17 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-varnish-7-5-0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build-php-8-3

on: workflow_dispatch

jobs:
php-8-3:
runs-on: self-hosted
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: images/varnish/7.5.0-alpine
platforms: linux/amd64,linux/arm64
push: true
tags: |
webgrip/magento-varnish:7.5.0
211 changes: 194 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,205 @@
version: '3.8'
## Mark Shust's Docker Configuration for Magento
## (https://github.com/markshust/docker-magento)
##
## Version 45.1.0

## To use SSH, see https://github.com/markshust/docker-magento#ssh
## Linux users, see https://github.com/markshust/docker-magento#linux

## If you changed the default Docker network, you may need to replace
## 172.17.0.1 in this file with the result of:
## docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}'

services:
nginx:
build:
context: ./images/nginx/1.18
dockerfile: Dockerfile
image: webgrip/magento-nginx:1.18
labels:
- "traefik.enable=true"
- "traefik.http.routers.your-service.rule=Host(`docker-magento.test`)"
- "traefik.http.routers.your-service.entrypoints=websecure"
- "traefik.http.routers.your-service.tls.certresolver=myresolver"
ports:
- "80:8000"
- "443:8443"
depends_on:
- php-fpm
volumes: &appvolumes
# - ~/.composer:/var/www/.composer:cached
# - ~/.ssh/id_rsa:/var/www/.ssh/id_rsa:cached
# - ~/.ssh/id_ed25519:/var/www/.ssh/id_ed25519:cached
# - ~/.ssh/known_hosts:/var/www/.ssh/known_hosts:cached
- ./src:/var/www/html
# - appdata:/var/www/html
# - sockdata:/sock
# - ssldata:/etc/nginx/certs
#extra_hosts: &appextrahosts
## Selenium support, replace "magento.test" with URL of your site
#- "magento.test:172.17.0.1"
## Linux, uncomment for Xdebug capabilities:
#- "host.docker.inidsternal:host-gateway"

php-fpm:
image: webgrip/magento-php:8.2-fpm
env_file: docker/env/phpfpm.env
ports:
- 9000
- 9003
volumes:
- ./src:/var/www/html:rw
depends_on:
- mysql
- redis
- opensearch
environment:
PHP_IDE_CONFIG: "serverName=localhost"
#extra_hosts: *appextrahosts

mysql:
image: mysql:8.0
ports:
- 3306
volumes:
- mysql-data:/var/lib/mysql
- ./docker-compose/mysql/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento2
MYSQL_USER: magento2
MYSQL_PASSWORD: magento2

# mariadb:
# image: mariadb:10.6
# command:
# --max_allowed_packet=64M
# --optimizer_use_condition_selectivity=1
# --optimizer_switch="rowid_filter=off"
# ports:
# - "3306:3306"
# env_file: docker/env/db.env
# volumes:
# - dbdata:/var/lib/mysql

# opensearch:
# image: webgrip/magento-opensearch:2.5
# build:
# context: ./images/opensearch/2.5
# dockerfile: Dockerfile
# ports:
# - "9200:9200"
# - "9300:9300"
# volumes:
# - opensearch-data:/usr/share/elasticsearch/data
# environment:
# ES_JAVA_OPTS: "-Xms2048m -Xmx2048m -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -Xss1m"
# OPENSEARCH_JAVA_OPTS: "-Xms2048m -Xmx2048m"
# discovery.type: single-node
# cluster.routing.allocation.disk.threshold_enabled: false
# script.painless.regex.enabled: true
# bootstrap.memory_lock: true
# network.host: 0.0.0.0
# cluster.name: opensearch-cluster
# node.name: opensearch-node1
# index.blocks.read_only_allow_delete: true
# # max_map_count: 262144 ## Uncomment the following line to increase the virtual memory map count

redis:
image: redis:7.0-alpine
ports:
- "6379:6379"

## If you wish to use Elasticsearch, comment out opensearch image above and
## uncomment this block. Do the same in the composer.healthcheck.yaml file.
# Additionally, if you are performing the manual setup, you will need to
# update the bin/setup command to use the $ES_HOST variable as the value for
# the --elasticsearch-host argument passed to bin/magento setup:install.
elasticsearch:
image: webgrip/magento-elasticsearch:7.17.19
ports:
- "9200:9200"
- "9300:9300"
env_file: docker/env/elasticsearch.env
environment:
- "discovery.type=single-node"
## Avoid test failures due to small disks
## More info at https://github.com/markshust/docker-magento/issues/488
- "cluster.routing.allocation.disk.threshold_enabled=false"
- "index.blocks.read_only_allow_delete"
## Uncomment the following line to increase the virtual memory map count
- "max_map_count=262144"

rabbitmq:
image: webgrip/magento-rabbitmq:3.11
ports:
- "80:80"
- "443:443" #Set to auto for auto-detection
- "15672:15672"
- "5672:5672"
volumes:
- ./path/to/website:/var/www/html
- ssldata:/etc/nginx/certs
healthcheck:
test: curl --fail http://localhost/ || exit 1
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
php:
- rabbitmqdata:/var/lib/rabbitmq
env_file: docker/env/rabbitmq.env

mailcatcher:
image: sj26/mailcatcher
ports:
- "1080:1080"

mailhog:
image: mailhog/mailhog
restart: 'always'
ports:
- 1025:1025
- 8025:8025

## Cloudflare tunnel support, uncomment to enable
#tunnel:
# container_name: cloudflared-tunnel
# image: cloudflare/cloudflared:latest
# command: tunnel run
# env_file: docker/env/cloudflare.env

## Blackfire support, uncomment to enable
#blackfire:
# image: blackfire/blackfire:2
# ports:
# - "8307"
# env_file: docker/env/blackfire.env

## Selenium support, uncomment to enable
#selenium:
# image: selenium/standalone-chrome-debug:3.8.1
# ports:
# - "5900:5900"
# extra_hosts: *appextrahosts


varnish:
image: webgrip/magento-varnish:6.0
container_name: varnish
build:
context: ./images/php/8.2
context: ./images/varnish/7.5.0-alpine
dockerfile: Dockerfile
ports:
- "6081:6081"
volumes:
- ./default.vcl:/etc/varnish/default.vcl:ro
depends_on:
- nginx
tmpfs:
- /var/lib/varnish:exec # Optional: Use tmpfs for Varnish storage to increase cache responsiveness
command: "-p default_keep=300"
environment:
- VARNISH_SIZE=2G



volumes:
ssldata:
appdata:
dbdata:
rabbitmqdata:
sockdata:
ssldata:
mysql-data:
opensearch-data:

networks:
default:
magento:
external: true
3 changes: 3 additions & 0 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo "Hello, World!";

0 comments on commit 2bffa6a

Please sign in to comment.