-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
77 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: eucyt/mypaper | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,34 @@ | ||
# For github action | ||
FROM php:8.2-fpm-buster as builder | ||
|
||
COPY ./docker/php/php.ini /usr/local/etc/php/php.ini | ||
|
||
COPY ./laravel /laravel | ||
WORKDIR /laravel | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install git unzip libzip-dev libicu-dev libonig-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
docker-php-ext-install intl pdo_mysql zip bcmath | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
RUN composer install --no-dev && composer global require "laravel/installer" | ||
|
||
RUN if [ ! -d "database/seeds" ]; then mkdir database/seeds; fi | ||
RUN if [ ! -d "database/factories" ]; then mkdir database/factories; fi | ||
|
||
RUN php artisan cache:clear \ | ||
&& php artisan config:clear \ | ||
&& php artisan route:clear \ | ||
&& php artisan view:clear | ||
|
||
RUN chown -R www-data:www-data storage | ||
|
||
|
||
FROM php:8.2-apache | ||
|
||
COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/ | ||
COPY --from=builder /laravel /var/www/laravel | ||
|
||
RUN a2ensite 000-default |
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,10 @@ | ||
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so | ||
|
||
<VirtualHost *:80> | ||
DocumentRoot /var/www/laravel/public | ||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
<Directory /var/www/html/laravelapp/public> | ||
AllowOverride All | ||
</Directory> | ||
</VirtualHost> |