An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
automatically parse version of coolify for building prod image
Andras Bacsaibc6feed17ffe
diff --git a/.github/workflows/production-build.yml b/.github/workflows/production-build.ymlindex 8dde931718..52dcaad257 100644--- a/.github/workflows/production-build.yml+++ b/.github/workflows/production-build.yml@@ -13,23 +13,16 @@ jobs:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3- - name: Cache Docker layers- uses: actions/cache@v2- with:- path: |- /usr/local/share/ca-certificates- /var/cache/apt/archives- /var/lib/apt/lists- ~/.cache- key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}- restore-keys: |- ${{ runner.os }}-docker-- name: Login to ghcr.iouses: docker/login-action@v2with:registry: ${{ env.REGISTRY }}username: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}+ - name: Get Version+ id: version+ run: |+ echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getVersion.php)"|xargs >> $GITHUB_OUTPUT- name: Build image and push to registryuses: docker/build-push-action@v3with:@@ -37,4 +30,8 @@ jobs:file: docker/prod-ssu/Dockerfileplatforms: linux/amd64push: true- tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:4.0.0-nightly.0+ tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}+ - uses: sarisia/actions-status-discord@v1+ if: always()+ with:+ webhook: ${{ secrets.DISCORD_WEBHOOK_DEV_RELEASE_CHANNEL }}diff --git a/bootstrap/getVersion.php b/bootstrap/getVersion.phpnew file mode 100644index 0000000000..1188f0fec4--- /dev/null+++ b/bootstrap/getVersion.php@@ -0,0 +1,3 @@+<?php+$version = include 'config/coolify.php';+echo $version['version'];diff --git a/docker/prod-ssu/Dockerfile b/docker/prod-ssu/Dockerfileindex 04164cff55..1f87a69236 100644--- a/docker/prod-ssu/Dockerfile+++ b/docker/prod-ssu/Dockerfile@@ -12,10 +12,14 @@ RUN apt-get -y autoremove \&& apt-get clean \&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*-COPY --chmod=755 docker/prod-ssu/etc/s6-overlay/ /etc/s6-overlay/+COPY composer.json composer.lock ./+RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist+COPY --chown=9999:9999 . .-COPY --from=static-assets --chown=9999:9999 /app/public/build /var/www/html/public/build+RUN composer dump-autoload++COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build+COPY --chmod=755 docker/prod-ssu/etc/s6-overlay/ /etc/s6-overlay/-RUN composer install --no-dev --optimize-autoloaderRUN php artisan route:cacheRUN php artisan view:cache