Skip to content

Commit

Permalink
Merge branch 'development' into chore-docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Dec 12, 2024
2 parents f856c51 + 762b366 commit 81295ad
Show file tree
Hide file tree
Showing 88 changed files with 5,718 additions and 2,432 deletions.
36 changes: 36 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/app/public
/storage/debugbar
/storage/ssr
/storage/clockwork
/storage/logs
/storage/pail
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/vendor
.env.backup
/.idea/sonarlint
.phpstorm.meta.php
_ide_helper_models.php
_ide_helper.php
.php-cs-fixer.cache
.husky
/.vscode
**/.DS_Store
/public/page-cache
.phpunit.database.checksum
.phpunit.cache
rr
.rr.yaml
frankenphp
.config
.data
.git
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# This worklflow will perform following actions when the code is pushed to development branch:
# - Build the latest docker image in development.
# - Push the latest docker image to Google Artifact Registry-Dev.
# - Rollout the latest image in GKE.
#
# Maintainers:
# - name: Chandu Nainala
# - email: [email protected]

name : Build COCONUT image

on:
push:
branches: [development]

env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
REPOSITORY_NAME: coconut
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
APP_IMAGE: coconut-app
REPOSITORY_NAMESPACE: nfdi4chem

jobs:
setup-build-publish-deploy-dev:
name: Build & deploy to development
runs-on: ubuntu-latest
environment:
name: Dev
steps:
# Checkout code
- name: Checkout
uses: actions/checkout@v4

# Login to Docker
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}

# Build and push the app Docker image
- name: Build and push App Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./FrankenPHP.Dockerfile
push: true
build-args: |
RELEASE_VERSION=latest
COMPOSER_AUTH=${{ secrets.COMPOSER_AUTH }}
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:latest
97 changes: 0 additions & 97 deletions .github/workflows/dev-build.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
/public/build
/public/hot
/public/storage
/resources/scripts/python/20*
/storage/*.key
/storage/molecules_2d*
/storage/molecules_3d*
/vendor
.env
.env.backup
Expand All @@ -20,5 +23,8 @@ yarn-error.log
storage/*.tsv
storage/*.csv
.DS_store
**/caddy
frankenphp
frankenphp-worker.php
/docs/.vitepress/cache
/docs/.vitepress/dist
174 changes: 174 additions & 0 deletions FrankenPHP.Alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Accepted values: 8.3 - 8.2
ARG PHP_VERSION=8.3

ARG FRANKENPHP_VERSION=latest

ARG COMPOSER_VERSION=latest

###########################################
# Build frontend assets with Bun
###########################################

ARG BUN_VERSION="latest"

FROM oven/bun:${BUN_VERSION} AS build

ENV ROOT=/var/www/html

WORKDIR ${ROOT}

COPY --link package.json bun.lockb* ./

RUN bun install --frozen-lockfile

COPY --link . .

RUN bun run build

###########################################

FROM composer:${COMPOSER_VERSION} AS vendor

FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine

LABEL maintainer="SMortexa <[email protected]>"
LABEL org.opencontainers.image.title="Laravel Octane Dockerfile"
LABEL org.opencontainers.image.description="Production-ready Dockerfile for Laravel Octane"
LABEL org.opencontainers.image.source=https://github.com/exaco/laravel-octane-dockerfile
LABEL org.opencontainers.image.licenses=MIT

ARG WWWUSER=1000
ARG WWWGROUP=1000
ARG TZ=UTC
ARG APP_DIR=/var/www/html

ENV TERM=xterm-color \
WITH_HORIZON=false \
WITH_SCHEDULER=false \
OCTANE_SERVER=frankenphp \
USER=octane \
ROOT=${APP_DIR} \
COMPOSER_FUND=0 \
COMPOSER_MAX_PARALLEL_HTTP=24 \
XDG_CONFIG_HOME=${APP_DIR}/.config \
XDG_DATA_HOME=${APP_DIR}/.data

WORKDIR ${ROOT}

SHELL ["/bin/sh", "-eou", "pipefail", "-c"]

RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone

RUN apk update; \
apk upgrade; \
apk add --no-cache \
curl \
wget \
vim \
git \
ncdu \
procps \
ca-certificates \
supervisor \
libsodium-dev \
# Install PHP extensions (included with dunglas/frankenphp)
&& install-php-extensions \
bz2 \
pcntl \
mbstring \
bcmath \
sockets \
pgsql \
pdo_pgsql \
opcache \
exif \
pdo_mysql \
zip \
intl \
gd \
redis \
rdkafka \
memcached \
igbinary \
ldap \
swoole \
&& docker-php-source delete \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*

RUN arch="$(apk --print-arch)" \
&& case "$arch" in \
armhf) _cronic_fname='supercronic-linux-arm' ;; \
aarch64) _cronic_fname='supercronic-linux-arm64' ;; \
x86_64) _cronic_fname='supercronic-linux-amd64' ;; \
x86) _cronic_fname='supercronic-linux-386' ;; \
*) echo >&2 "error: unsupported architecture: $arch"; exit 1 ;; \
esac \
&& wget -q "https://github.com/aptible/supercronic/releases/download/v0.2.29/${_cronic_fname}" \
-O /usr/bin/supercronic \
&& chmod +x /usr/bin/supercronic \
&& mkdir -p /etc/supercronic \
&& echo "*/1 * * * * php ${ROOT}/artisan schedule:run --no-interaction" > /etc/supercronic/laravel

RUN addgroup -g ${WWWGROUP} ${USER} \
&& adduser -D -h ${ROOT} -G ${USER} -u ${WWWUSER} -s /bin/sh ${USER}

RUN mkdir -p /var/log/supervisor /var/run/supervisor \
&& chown -R ${USER}:${USER} ${ROOT} /var/log /var/run \
&& chmod -R a+rw ${ROOT} /var/log /var/run

RUN cp ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini

USER ${USER}

COPY --link --chown=${WWWUSER}:${WWWUSER} --from=vendor /usr/bin/composer /usr/bin/composer
COPY --link --chown=${WWWUSER}:${WWWUSER} composer.json composer.lock ./

RUN composer install \
--no-dev \
--no-interaction \
--no-autoloader \
--no-ansi \
--no-scripts \
--audit

COPY --link --chown=${WWWUSER}:${WWWUSER} . .
COPY --link --chown=${WWWUSER}:${WWWUSER} --from=build ${ROOT}/public public

RUN mkdir -p \
storage/framework/sessions \
storage/framework/views \
storage/framework/cache \
storage/framework/testing \
storage/logs \
bootstrap/cache && chmod -R a+rw storage

COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.conf /etc/supervisor/
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/octane/FrankenPHP/supervisord.frankenphp.conf /etc/supervisor/conf.d/
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/supervisord.*.conf /etc/supervisor/conf.d/
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/start-container /usr/local/bin/start-container
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/healthcheck /usr/local/bin/healthcheck
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini ${PHP_INI_DIR}/conf.d/99-octane.ini

# FrankenPHP embedded PHP configuration
COPY --link --chown=${WWWUSER}:${WWWUSER} deployment/php.ini /lib/php.ini

RUN composer install \
--classmap-authoritative \
--no-interaction \
--no-ansi \
--no-dev \
&& composer clear-cache

RUN chmod +x /usr/local/bin/start-container /usr/local/bin/healthcheck

RUN cat deployment/utilities.sh >> ~/.bashrc

EXPOSE 8000
EXPOSE 443
EXPOSE 443/udp
EXPOSE 2019

ENTRYPOINT ["start-container"]

HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD healthcheck || exit 1
Loading

0 comments on commit 81295ad

Please sign in to comment.