-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb8ccd2
commit ebeb493
Showing
9 changed files
with
207 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(caching) { | ||
@static { | ||
file | ||
path *.css *.js *.ico *.gif *.jpg *.jpeg *.png *.svg *.woff | ||
path /build/* | ||
path /media/* | ||
} | ||
handle @static { | ||
header Cache-Control "public, max-age=31536000, must-revalidate" | ||
} | ||
@nocache { | ||
path /sitemap* | ||
} | ||
handle @nocache { | ||
header Cache-Control "no-cache, no-store, must-revalidate" | ||
} | ||
} | ||
|
||
:80 { | ||
root * {$DOCUMENT_ROOT:/var/www/html/} | ||
|
||
# Point all PHP requests to an upstream socket, served by php-fpm | ||
php_fastcgi localhost:9000 { | ||
trusted_proxies private_ranges | ||
capture_stderr | ||
} | ||
|
||
# Enable logging | ||
log { | ||
output stderr | ||
format console | ||
level ERROR | ||
} | ||
|
||
log { | ||
output discard | ||
level INFO | ||
} | ||
|
||
file_server | ||
push | ||
|
||
# Enable gzip compression (and zstd) | ||
encode zstd gzip | ||
|
||
import caching | ||
} | ||
|
||
:2021 { | ||
tls internal | ||
metrics | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
su -s /bin/bash -c "mkdir -p var/cache var/log var/sessions public/media" www-data | ||
su -s /bin/bash -c "chmod -R 777 public/media" www-data | ||
su -s /bin/bash -c "php bin/console doctrine:database:drop --force" www-data | ||
su -s /bin/bash -c "php bin/console doctrine:database:create --if-not-exists" www-data | ||
su -s /bin/bash -c "php bin/console doctrine:migrations:migrate -n" www-data | ||
su -s /bin/bash -c "php bin/console sylius:fixtures:load default -n" www-data | ||
su -s /bin/bash -c "php bin/console doctrine:query:sql \"UPDATE sylius_channel SET theme_name = 'agence-adeliom/sylius-tailwindcss-theme'\"" www-data | ||
su -s /bin/bash -c "php bin/console cache:clear" www-data | ||
|
||
|
||
if [ "${1}" = "-D" ]; then | ||
# start supervisord and services | ||
exec /usr/bin/supervisord -n -c /etc/supervisord.conf | ||
else | ||
exec "$@" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
install | ||
etc | ||
docs | ||
node_modules | ||
.git | ||
.github | ||
.ddev | ||
tests | ||
.idea | ||
.cd .babelrc | ||
.DS_Store | ||
debug |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Release" | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
tests: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 2 | ||
# Fetch submodules | ||
submodules: recursive | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: adeliom/sylius-tailwindcss-theme | ||
tags: | | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
build-args: | | ||
VERSION=${{ steps.meta.outputs.version }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM adeliom/php:8.2-caddy-node20 | ||
|
||
ARG SYLIUS_VERSION=1.12.0 | ||
ARG SYMFONY_VERSION=6.4 | ||
|
||
RUN apk add --update make | ||
|
||
RUN mkdir -p /opt/sylius | ||
|
||
COPY . /opt/sylius | ||
|
||
RUN cd /opt/sylius && \ | ||
make install-docker -e SYLIUS_VERSION=$SYLIUS_VERSION SYMFONY_VERSION=$SYMFONY_VERSION | ||
|
||
RUN cp -ra /opt/sylius/install/Application/. /var/www/html && \ | ||
rm -rf /opt/sylius && \ | ||
chown -R www-data:www-data /var/www/html | ||
|
||
ENV DOCUMENT_ROOT=/var/www/html/public/ | ||
|
||
ENV PHP_INI_MEMORY_LIMIT=1G | ||
ENV PHP_INI_OPCACHE_MEMORY_CONSUMPTION=1024 | ||
ENV PHP_INI_OPCACHE_INTERNED_STRINGS_BUFFER=256 | ||
ENV PHP_INI_OPCACHE_MAX_ACCELERATED_FILES=20000 | ||
ENV PHP_INI_OPCACHE_VALIDATE_TIMESTAMPS=0 | ||
ENV PHP_INI_REALPATH_CACHE_TTL=600 | ||
|
||
|
||
WORKDIR /var/www/html | ||
EXPOSE 80 | ||
|
||
COPY .docker/Caddyfile /etc/caddy/Caddyfile | ||
COPY .docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint | ||
RUN chmod +x /usr/local/bin/docker-entrypoint |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: sylius-tailwindcss-theme | ||
services: | ||
sylius: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: sylius | ||
environment: | ||
APP_ENV: dev | ||
DATABASE_URL: mysql://user:password@database:3306/mydatabase?serverVersion=10.11.7-MariaDB&charset=utf8mb4 | ||
ports: | ||
- 80:80 | ||
database: | ||
image: mariadb:10 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: mydatabase | ||
MYSQL_USER: user | ||
MYSQL_PASSWORD: password | ||
volumes: | ||
- data:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
|
||
volumes: | ||
data: |