From 548e92d62ae415ebe0b7befce501803bf085fa57 Mon Sep 17 00:00:00 2001 From: Anthonius Munthi Date: Mon, 19 Aug 2024 08:57:50 +0800 Subject: [PATCH] chore(ci): added github build image action --- .env | 2 +- .github/workflows/ci.yaml | 5 +++++ Dockerfile | 1 + compose.override.yaml | 2 ++ compose.yaml | 4 +++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 547596f..173d00f 100644 --- a/.env +++ b/.env @@ -23,7 +23,7 @@ APP_SECRET=aada04600f99360ff1073e352fcb60e0 # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml # -DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" +# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" # DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e6287b1..cea9701 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,3 +26,8 @@ jobs: ./bin/console doctrine:schema:create codecov: true secrets: inherit + + build: + name: Build Image + uses: kilip/gh-php-common/.github/workflows/build-image.yaml@main + secrets: inherit diff --git a/Dockerfile b/Dockerfile index e867aee..f130182 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ RUN set -eux; \ ; COPY --link frankenphp/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/ +COPY --link composer.* symfony.* ./ CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ] diff --git a/compose.override.yaml b/compose.override.yaml index a3dd879..35a752f 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -3,6 +3,8 @@ services: php: build: target: frankenphp_dev + volumes: + - ./:/app ###> doctrine/doctrine-bundle ### database: diff --git a/compose.yaml b/compose.yaml index e3f7f09..f6ff642 100644 --- a/compose.yaml +++ b/compose.yaml @@ -7,12 +7,14 @@ services: context: . target: frankenphp_dev restart: unless-stopped + depends_on: + - database environment: SERVER_NAME: ${SERVER_NAME:-localhost}, php:80 MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM - DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASS:-!ChangeMe!}@$:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8} + DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASS:-!ChangeMe!}@${POSTGRES_HOST:-database}:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8} # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure} MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure}