-
Notifications
You must be signed in to change notification settings - Fork 9
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
c19f3e2
commit 4d99451
Showing
7 changed files
with
142 additions
and
0 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
.git | ||
.gitignore | ||
.gitattributes | ||
node_modules | ||
vendor |
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,64 @@ | ||
name: Build container image | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/metadata-action@v5 | ||
id: meta_foundation | ||
with: | ||
images: ghcr.io/tissue-foundation | ||
|
||
- uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./docker/production/foundation.dockerfile | ||
tags: ${{ steps.meta_foundation.outputs.tags }} | ||
labels: ${{ steps.meta_foundation.outputs.labels }} | ||
|
||
- uses: docker/metadata-action@v5 | ||
id: meta_nginx | ||
with: | ||
images: ghcr.io/tissue-nginx | ||
|
||
- uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./docker/production/nginx.dockerfile | ||
tags: ${{ steps.meta_nginx.outputs.tags }} | ||
labels: ${{ steps.meta_nginx.outputs.labels }} | ||
build-args: | | ||
TISSUE_FOUNDATION_IMAGE_NAME=${{ steps.meta_foundation.outputs.tags }} | ||
- uses: docker/metadata-action@v5 | ||
id: meta_php | ||
with: | ||
images: ghcr.io/tissue-php | ||
|
||
- uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./docker/production/php.dockerfile | ||
tags: ${{ steps.meta_php.outputs.tags }} | ||
labels: ${{ steps.meta_php.outputs.labels }} | ||
build-args: | | ||
TISSUE_FOUNDATION_IMAGE_NAME=${{ steps.meta_foundation.outputs.tags }} |
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,12 @@ | ||
services: | ||
php: | ||
image: shibafu528/tissue-php | ||
env_file: .env | ||
nginx: | ||
image: shibafu528/tissue-nginx | ||
environment: | ||
PHP_APP_HOST: php | ||
ports: | ||
- 4519:80 | ||
depends_on: | ||
- php |
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,18 @@ | ||
server { | ||
listen 80; | ||
server_name _; | ||
|
||
root /app/public; | ||
index index.php index.html; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass ${PHP_APP_HOST}:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |
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,22 @@ | ||
FROM php:8.0.30-cli-bullseye as php | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y git libpq-dev unzip libicu-dev \ | ||
&& docker-php-ext-install pdo_pgsql intl \ | ||
&& curl -sS https://getcomposer.org/installer | php \ | ||
&& mv composer.phar /usr/local/bin/composer \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN composer install -n --no-dev --prefer-dist --optimize-autoloader | ||
|
||
FROM node:16.20.2-bullseye | ||
|
||
WORKDIR /app | ||
COPY --from=php /app /app | ||
|
||
RUN yarn install \ | ||
&& yarn run prod \ | ||
&& yarn run doc |
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 @@ | ||
ARG TISSUE_FOUNDATION_IMAGE_NAME | ||
|
||
FROM ${TISSUE_FOUNDATION_IMAGE_NAME} as foundation | ||
|
||
FROM nginx:alpine | ||
|
||
COPY ./docker/production/default.conf.template /etc/nginx/templates/ | ||
|
||
COPY --from=foundation /app/public /app/public |
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,15 @@ | ||
ARG TISSUE_FOUNDATION_IMAGE_NAME | ||
|
||
FROM ${TISSUE_FOUNDATION_IMAGE_NAME} as foundation | ||
|
||
FROM php:8.0.30-fpm-bullseye | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends libpq-dev libicu-dev \ | ||
&& docker-php-ext-install pdo_pgsql intl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=foundation --chown=www-data:www-data /app /app | ||
|
||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|