From bd3fce7e647f64b60e7f454ec4fe18c92d7b8505 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 7 Jun 2022 22:00:00 +0100 Subject: [PATCH] Initial commit --- .gitignore | 3 + assets/css/tailwind.css | 18 + assets/tailwind.config.js | 33 ++ composer.json | 9 + composer.lock | 423 ++++++++++++++++++ docker-compose.override.yaml.example | 16 + docker-compose.yaml | 25 ++ public/index.php | 13 + resources/data.yaml | 77 ++++ run | 22 + templates/includes/button.html.twig | 3 + .../episode-list-pagination.html.twig | 10 + templates/includes/episode-list.html.twig | 9 + .../includes/episode-listen-button.html.twig | 5 + templates/includes/episode-teaser.html.twig | 18 + templates/includes/footer-menu.html.twig | 8 + templates/includes/footer.html.twig | 7 + templates/includes/main-menu.html.twig | 7 + templates/includes/navbar.html.twig | 33 ++ templates/includes/search-form.html.twig | 14 + templates/includes/sidebar.html.twig | 42 ++ templates/layouts/base.html.twig | 37 ++ templates/layouts/home.html.twig | 5 + tools/docker/Dockerfile | 47 ++ tools/docker/web/root/etc/caddy/Caddyfile | 4 + 25 files changed, 888 insertions(+) create mode 100644 .gitignore create mode 100644 assets/css/tailwind.css create mode 100644 assets/tailwind.config.js create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 docker-compose.override.yaml.example create mode 100644 docker-compose.yaml create mode 100644 public/index.php create mode 100644 resources/data.yaml create mode 100755 run create mode 100644 templates/includes/button.html.twig create mode 100644 templates/includes/episode-list-pagination.html.twig create mode 100644 templates/includes/episode-list.html.twig create mode 100644 templates/includes/episode-listen-button.html.twig create mode 100644 templates/includes/episode-teaser.html.twig create mode 100644 templates/includes/footer-menu.html.twig create mode 100644 templates/includes/footer.html.twig create mode 100644 templates/includes/main-menu.html.twig create mode 100644 templates/includes/navbar.html.twig create mode 100644 templates/includes/search-form.html.twig create mode 100644 templates/includes/sidebar.html.twig create mode 100644 templates/layouts/base.html.twig create mode 100644 templates/layouts/home.html.twig create mode 100644 tools/docker/Dockerfile create mode 100644 tools/docker/web/root/etc/caddy/Caddyfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4c08e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/docker-compose.override.yaml +/public/build/ +/vendor/ diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css new file mode 100644 index 0000000..a7c9026 --- /dev/null +++ b/assets/css/tailwind.css @@ -0,0 +1,18 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer components { + h1:after, + h1:before { + @apply text-3xl leading-[0] italic sm:text-5xl md:text-3xl lg:text-4xl xl:text-5xl; + } + + h1:after { + content: "”"; + } + + h1:before { + content: "“"; + } +} diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js new file mode 100644 index 0000000..82f6374 --- /dev/null +++ b/assets/tailwind.config.js @@ -0,0 +1,33 @@ +module.exports = { + content: ["./templates/**/*.twig"], + theme: { + colors: { + blue: { + 100: '#8cc4df', + 200: '#2aaae1', + 800: '#064871', + }, + gray: '#666666', + secondary: '#064871', + white: '#FFFFFF', + red: 'lightcoral', + }, + extend: { + fontFamily: { + sans: [ + "proxima-nova", + "Proxima Nova", + "Open Sans", + "Gill Sans MT", + "Gill Sans", + 'Corbel', + 'Arial', + 'sans-serif', + ] + }, + spacing: { + 18: '4.5rem', + } + } + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..a2d3d72 --- /dev/null +++ b/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "twig/twig": "^3.3", + "symfony/yaml": "^6.0" + }, + "require-dev": { + "symfony/var-dumper": "^6.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c0129a9 --- /dev/null +++ b/composer.lock @@ -0,0 +1,423 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "62bcc6571861d86a150efd3245f35566", + "packages": [ + { + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/yaml", + "version": "v6.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "e77f3ea0b21141d771d4a5655faa54f692b34af5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e77f3ea0b21141d771d4a5655faa54f692b34af5", + "reference": "e77f3ea0b21141d771d4a5655faa54f692b34af5", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v6.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-26T17:23:29+00:00" + }, + { + "name": "twig/twig", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "8442df056c51b706793adf80a9fd363406dd3674" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", + "reference": "8442df056c51b706793adf80a9fd363406dd3674", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.3.10" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2022-04-06T06:47:41+00:00" + } + ], + "packages-dev": [ + { + "name": "symfony/var-dumper", + "version": "v6.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "fa61dfb4bd3068df2492013dc65f3190e9f550c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/fa61dfb4bd3068df2492013dc65f3190e9f550c0", + "reference": "fa61dfb4bd3068df2492013dc65f3190e9f550c0", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<5.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/uid": "^5.4|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v6.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-26T13:22:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/docker-compose.override.yaml.example b/docker-compose.override.yaml.example new file mode 100644 index 0000000..a9ad6d2 --- /dev/null +++ b/docker-compose.override.yaml.example @@ -0,0 +1,16 @@ +services: + node: + build: + context: . + dockerfile: tools/docker/Dockerfile + target: assets + volumes: + - assets:/app/public/build + - ./:/app + working_dir: /app + entrypoint: bash + command: "./run yarn:build:css" + user: node + tty: true + environment: + - "NODE_ENV=development" diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..6b46fb5 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,25 @@ +services: + web: + build: + context: . + dockerfile: tools/docker/Dockerfile + target: web + volumes: + - .:/app + - assets:/app/public/build + working_dir: /app + ports: + - "${DOCKER_WEB_PORT:-127.0.0.1:80}:80" + depends_on: + - php + + php: + build: + context: . + dockerfile: tools/docker/Dockerfile + target: php-fpm + volumes: + - .:/app + +volumes: + assets: {} diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..89b81d8 --- /dev/null +++ b/public/index.php @@ -0,0 +1,13 @@ + true]); + +echo $twig->render('layouts/home.html.twig', Yaml::parseFile('../resources/data.yaml')); diff --git a/resources/data.yaml b/resources/data.yaml new file mode 100644 index 0000000..3c79d2a --- /dev/null +++ b/resources/data.yaml @@ -0,0 +1,77 @@ +--- +episodes: + - + number: 338 + title: Tailwind CSS + date: 2022-03-08 + description: | +

Today we are talking about Tailwind CSS with Oliver Davies.

+ - + number: 337 + title: Layout Paragraphs + date: 2022-03-01 + description: | +

Today we are talking about Layout Paragraphs with Justin Toupin.

+ - + number: 336 + title: Discover Drupal + date: 2022-02-22 + description: | +

Today we are talking about Discover Drupal with Angie Sabin.

+ - + number: 335 + title: LocalGov + date: 2022-02-15 + description: | +

Today we are talking about LocalGov Drupal.

+ - + number: 334 + title: Managing Drupal teams in Government + date: 2022-02-08 + description: | +

Today we are talking about Leading a Drupal Team in Government with Abigail Bowman and Laura Larrimore.

+ - + number: 333 + title: Behat + date: 2022-02-01 + description: | +

Today we are talking about Behat with Chris Burgess.

+ - + number: 332 + title: Permissions management + date: 2022-01-25 + description: | +

Today we are talking about Permission Management with Benji Fisher.

+ - + number: 331 + title: Migrating Paragraphs for the National Zoo + date: 2022-01-18 + description: | +

Today we are talking about Migrating Paragraphs for the National Zoo with Mohammed El-Khatib.

+ - + number: 330 + title: Remote Development on a LAN + date: 2022-01-11 + description: | +

Today we are talking about Remote Development on a LAN.

+ - + number: 329 + title: The Penguin Corps + date: 2022-01-04 + description: | +

Today we are talking about The Penguin Corps with Stu Keroff and Students from the Penguin Corps.

+main_menu: + - + title: Home + is_active: true + - + title: About Us + is_active: false + - + title: Hosts + is_active: false + - + title: Module of the Week + is_active: false +name: Talking Drupal +title: 'A weekly chat about web design and development by a group a guys with one thing in common, we love Drupal.' diff --git a/run b/run new file mode 100755 index 0000000..e9e8abb --- /dev/null +++ b/run @@ -0,0 +1,22 @@ +#!/bin/bash + +function yarn:build:css { + # Build the CSS assets, this is intended to be run within the "assets" container. + + local args=() + + if [[ "$NODE_ENV" == "development" ]]; then + args=(--watch) + else + args=(--minify) + fi + + tailwindcss \ + --config assets/tailwind.config.js \ + --content "templates/**/*.html.twig" \ + --input assets/css/tailwind.css \ + --output public/build/tailwind.css \ + "${args[@]}" +} + +eval "${@}" diff --git a/templates/includes/button.html.twig b/templates/includes/button.html.twig new file mode 100644 index 0000000..6b804bb --- /dev/null +++ b/templates/includes/button.html.twig @@ -0,0 +1,3 @@ + + {% block text '' %} + diff --git a/templates/includes/episode-list-pagination.html.twig b/templates/includes/episode-list-pagination.html.twig new file mode 100644 index 0000000..64d6ca8 --- /dev/null +++ b/templates/includes/episode-list-pagination.html.twig @@ -0,0 +1,10 @@ + diff --git a/templates/includes/episode-list.html.twig b/templates/includes/episode-list.html.twig new file mode 100644 index 0000000..7b797f8 --- /dev/null +++ b/templates/includes/episode-list.html.twig @@ -0,0 +1,9 @@ +
+ {% for episode in episodes %} + {% include "includes/episode-teaser.html.twig" with { episode } only %} + {% endfor %} + +
+ {% include "includes/episode-list-pagination.html.twig" %} +
+
diff --git a/templates/includes/episode-listen-button.html.twig b/templates/includes/episode-listen-button.html.twig new file mode 100644 index 0000000..a72c5b3 --- /dev/null +++ b/templates/includes/episode-listen-button.html.twig @@ -0,0 +1,5 @@ +{% embed "includes/button.html.twig" %} + {% block text %} + Listen to episode #{{ episode.number }} - {{ episode.title }} + {% endblock %} +{% endembed %} diff --git a/templates/includes/episode-teaser.html.twig b/templates/includes/episode-teaser.html.twig new file mode 100644 index 0000000..f28ebbe --- /dev/null +++ b/templates/includes/episode-teaser.html.twig @@ -0,0 +1,18 @@ +
+

+ + {{ name }} #{{ episode.number }} + - {{ episode.title }} + +

+ + + +
{{ episode.description|raw }}
+ +
+ {% include "includes/episode-listen-button.html.twig" with { episode } only %} +
+
diff --git a/templates/includes/footer-menu.html.twig b/templates/includes/footer-menu.html.twig new file mode 100644 index 0000000..4735a50 --- /dev/null +++ b/templates/includes/footer-menu.html.twig @@ -0,0 +1,8 @@ + + diff --git a/templates/includes/footer.html.twig b/templates/includes/footer.html.twig new file mode 100644 index 0000000..3fbe414 --- /dev/null +++ b/templates/includes/footer.html.twig @@ -0,0 +1,7 @@ + diff --git a/templates/includes/main-menu.html.twig b/templates/includes/main-menu.html.twig new file mode 100644 index 0000000..2212208 --- /dev/null +++ b/templates/includes/main-menu.html.twig @@ -0,0 +1,7 @@ + diff --git a/templates/includes/navbar.html.twig b/templates/includes/navbar.html.twig new file mode 100644 index 0000000..cb44df5 --- /dev/null +++ b/templates/includes/navbar.html.twig @@ -0,0 +1,33 @@ +
+
+ + Home + + +
+
+ +
+ + + +
+ {% include "includes/main-menu.html.twig" with { main_menu } only %} +
+
+
+ +
+

Search form

+ + {% include "includes/search-form.html.twig" %} +
+
diff --git a/templates/includes/search-form.html.twig b/templates/includes/search-form.html.twig new file mode 100644 index 0000000..32ab6a9 --- /dev/null +++ b/templates/includes/search-form.html.twig @@ -0,0 +1,14 @@ +
+
+ +
+ +
+ +
+
diff --git a/templates/includes/sidebar.html.twig b/templates/includes/sidebar.html.twig new file mode 100644 index 0000000..919463a --- /dev/null +++ b/templates/includes/sidebar.html.twig @@ -0,0 +1,42 @@ +
+
+

Links

+ +
+ Subscribe on iTunes + Listen on Google Play Music + Listen on Spotify +
+
+ +
+

Stay Updated

+
+

Sign up for our newsletter and receive

+ + {% embed "includes/button.html.twig" %} + {% block text "E-Mail Updates" %} + {% endembed %} +
+
+ + +
+

Contact

+
+

show@talkingdrupal.com

+

@talkingdrupal

+
+
+ +
+

Promote your Event

+
+

Learn about promoting your Drupal Event on Talking Drupal.

+ + {% embed "includes/button.html.twig" %} + {% block text "E-Mail Updates" %} + {% endembed %} +
+
+
diff --git a/templates/layouts/base.html.twig b/templates/layouts/base.html.twig new file mode 100644 index 0000000..952deda --- /dev/null +++ b/templates/layouts/base.html.twig @@ -0,0 +1,37 @@ + + + + + + {{ name }} + + + + + {% include "includes/navbar.html.twig" with { main_menu } only %} + +
+
+
+

{{ title }}

+
+ +
+
+
+ {% block content %}{% endblock %} +
+ + +
+
+
+
+ +
+ {% include "includes/footer.html.twig" with { main_menu } only %} +
+ + diff --git a/templates/layouts/home.html.twig b/templates/layouts/home.html.twig new file mode 100644 index 0000000..e77faae --- /dev/null +++ b/templates/layouts/home.html.twig @@ -0,0 +1,5 @@ +{% extends "layouts/base.html.twig" %} + +{% block content %} + {% include "includes/episode-list.html.twig" with { episodes } only %} +{% endblock %} diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile new file mode 100644 index 0000000..e9610b5 --- /dev/null +++ b/tools/docker/Dockerfile @@ -0,0 +1,47 @@ +FROM node:16 AS assets + +WORKDIR /app + +RUN yarn global add tailwindcss && mkdir -p /app/public/build && chown node:node -R /app/public/build + +COPY --chown=node:node assets assets +COPY --chown=node:node run ./ +COPY --chown=node:node templates templates + +USER node + +RUN ./run yarn:build:css + +### + +FROM php:8.1-fpm AS php-fpm + +COPY --from=composer /usr/bin/composer /usr/bin/composer + +WORKDIR /app + +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends \ + git \ + unzip \ + && useradd --create-home build \ + && chown build:build -R /app + +COPY --chown=build:build composer.* ./ + +USER build + +RUN composer install + +COPY --chown=build:build . . + +### + +FROM caddy:2 AS web + +COPY tools/docker/web/root/ / + +WORKDIR /app + +COPY --from=assets /app/public/build public/build +COPY public public diff --git a/tools/docker/web/root/etc/caddy/Caddyfile b/tools/docker/web/root/etc/caddy/Caddyfile new file mode 100644 index 0000000..9829c9c --- /dev/null +++ b/tools/docker/web/root/etc/caddy/Caddyfile @@ -0,0 +1,4 @@ +:80 +root * /app/public +php_fastcgi php:9000 +file_server