-
Notifications
You must be signed in to change notification settings - Fork 47
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
Showing
38 changed files
with
1,368 additions
and
1,464 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
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
# shamelessly copied from https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio | ||
# modified to meet our needs | ||
name: "Docker Image" | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- release | ||
tags: | ||
- v* | ||
|
||
|
@@ -27,35 +22,33 @@ jobs: | |
run: | | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
[ "$VERSION" == "main" ] && VERSION=main | ||
docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${{ github.run_number }}" \ | ||
--label "org.opencontainers.image.title=The Traewelling container image" \ | ||
echo "$VERSION" > VERSION | ||
docker build . --file Dockerfile \ | ||
--tag traewelling:$VERSION \ | ||
--tag traewelling:latest \ | ||
--label "runnumber=${{ github.run_number }}" \ | ||
--label "org.opencontainers.image.title=Traewelling" \ | ||
--label "org.opencontainers.image.version=$VERSION" \ | ||
--label "org.opencontainers.image.description=Easy-to-use deployment image of the Traewelling project" \ | ||
--label "org.opencontainers.image.url=https://github.com/Traewelling/traewelling#readme" \ | ||
--label "org.opencontainers.image.source=https://github.com/Traewelling/traewelling.git" \ | ||
--label "org.opencontainers.image.authors=Jonas Möller <[email protected]>" \ | ||
--label "org.opencontainers.image.vendor=The Traewelling team <[email protected]>" \ | ||
--label "org.opencontainers.image.license=AGPL-3.0" \ | ||
--label "org.opencontainers.image.base.name=docker.io/library/php:8-apache" | ||
--label "org.opencontainers.image.vendor=The Traewelling team <[email protected]>" \ | ||
--label "org.opencontainers.image.license=AGPL-3.0" | ||
- name: Log in to registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "release" ] && VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:latest | ||
docker push $IMAGE_ID:latest |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
vendor/ | ||
node_modules/ | ||
npm-debug.log | ||
report/ | ||
tests-coverage/ | ||
clover.xml | ||
|
||
# Profile pictures | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,20 +1,26 @@ | ||
FROM node:16-alpine as NodeBuildContainer | ||
FROM node:18-alpine as NodeBuildContainer | ||
COPY . /usr/src/trwl | ||
WORKDIR /usr/src/trwl | ||
RUN npm i && npm run prod | ||
|
||
FROM composer:2 as ComposerBuildContainer | ||
COPY --from=NodeBuildContainer /usr/src/trwl /usr/src/trwl | ||
WORKDIR /usr/src/trwl | ||
RUN composer install --ignore-platform-reqs | ||
RUN composer install --ignore-platform-reqs --no-interaction --no-dev --no-progress --no-suggest --optimize-autoloader | ||
|
||
FROM php:8.1-apache | ||
RUN apt update && apt install -y zlib1g-dev libpng-dev wait-for-it | ||
RUN docker-php-ext-install gd exif pdo pdo_mysql | ||
RUN a2enmod rewrite | ||
FROM php:8.1.5-apache | ||
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public | ||
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf | ||
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf | ||
|
||
RUN apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y zlib1g-dev libpng-dev wait-for-it && \ | ||
docker-php-ext-install gd exif pdo pdo_mysql && \ | ||
a2enmod rewrite && \ | ||
a2enmod http2 && \ | ||
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \ | ||
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf | ||
|
||
COPY --from=ComposerBuildContainer --chown=www-data:www-data /usr/src/trwl /var/www/html | ||
|
||
ENTRYPOINT ["/var/www/html/docker-entrypoint.sh"] | ||
CMD ["apache2-foreground"] |
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,9 @@ | ||
<?php | ||
|
||
namespace App\Exceptions\Checkin; | ||
|
||
use Exception; | ||
|
||
class AlreadyCheckedInException extends Exception | ||
{ | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.