-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
593d91a
commit 2ca4f5b
Showing
6 changed files
with
152 additions
and
4 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,71 @@ | ||
ARG ROAD_RUNNER_IMAGE=2024.2.0 | ||
ARG DOLT_IMAGE=1.42.8 | ||
|
||
# Build dolt binary | ||
FROM dolthub/dolt:$DOLT_IMAGE as dolt | ||
# Build rr binary | ||
FROM ghcr.io/roadrunner-server/roadrunner:$ROAD_RUNNER_IMAGE as rr | ||
# Clone the project | ||
FROM alpine/git as git | ||
|
||
ARG REPOSITORY=https://github.com/llm-agents-php/sample-app.git | ||
ARG BRANCH=main | ||
RUN git clone -b $BRANCH $REPOSITORY /app | ||
|
||
FROM php:8.3-cli-alpine3.18 | ||
|
||
RUN apk add --no-cache $PHPIZE_DEPS \ | ||
curl \ | ||
libcurl \ | ||
wget \ | ||
libzip-dev \ | ||
libmcrypt-dev \ | ||
libxslt-dev \ | ||
libxml2-dev \ | ||
openssl-dev \ | ||
icu-dev \ | ||
zip \ | ||
unzip \ | ||
linux-headers | ||
|
||
RUN docker-php-ext-install \ | ||
opcache \ | ||
zip \ | ||
dom \ | ||
sockets | ||
|
||
# PDO database drivers support | ||
RUN docker-php-ext-install pdo_mysql | ||
|
||
COPY --from=git /app /app | ||
COPY --from=rr /usr/bin/rr /app | ||
COPY --from=dolt /usr/local/bin/dolt /app | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
ARG APP_VERSION=v1.0 | ||
ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
|
||
WORKDIR /app | ||
|
||
RUN composer config --no-plugins allow-plugins.spiral/composer-publish-plugin false | ||
RUN composer install --no-dev | ||
|
||
WORKDIR /app | ||
|
||
RUN mkdir .db | ||
RUN ./dolt --data-dir=.db sql -q "create database llm;" | ||
|
||
ENV APP_ENV=prod | ||
ENV DEBUG=false | ||
ENV VERBOSITY_LEVEL=verbose | ||
ENV ENCRYPTER_KEY=def00000232ae92c8e8ec0699093fa06ce014cd48d39c3c62c279dd947db084e56ee48b5c91cebc1c5abe53f7755021d09043757561c244c1c0c765cfeb5db33eb45a903 | ||
ENV MONOLOG_DEFAULT_CHANNEL=roadrunner | ||
ENV MONOLOG_DEFAULT_LEVEL=INFO | ||
ENV APP_VERSION=$APP_VERSION | ||
ENV RR_LOG_LEVEL=error | ||
|
||
LABEL org.opencontainers.image.source=$REPOSITORY | ||
LABEL org.opencontainers.image.description="LL Agents PHP" | ||
LABEL org.opencontainers.image.licenses=MIT | ||
|
||
CMD ./rr serve -c .rr.yaml |
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,3 @@ | ||
# These are supported funding model platforms | ||
|
||
patreon: butschster |
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,47 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build-release: | ||
if: "!github.event.release.prerelease" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 'Get Previous tag' | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
with: | ||
fallback: v0.1 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_LOGIN }} | ||
password: ${{ secrets.GHCR_PASSWORD }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./.docker/Dockerfile | ||
push: true | ||
build-args: | | ||
APP_VERSION=${{ steps.previoustag.outputs.tag }} | ||
tags: | ||
ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.previoustag.outputs.tag }} |
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
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,7 @@ | ||
version: '3.7' | ||
|
||
services: | ||
app: | ||
build: "./.docker" | ||
environment: | ||
OPENAI_KEY: ${OPENAI_KEY} |