-
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.
Merge pull request #30 from feat/add-Dockerfile
build: Add Dockerfile for pipeline usage
- Loading branch information
Showing
4 changed files
with
67 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Container Role is used in start.sh | ||
CONTAINER_ROLE=app | ||
|
||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
|
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,23 @@ | ||
FROM webdevops/php-nginx:8.2 | ||
ENV WEB_DOCUMENT_ROOT /app/public | ||
ENV SERVICE_NGINX_CLIENT_MAX_BODY_SIZE 100m | ||
ENV FPM_PM_MAX_CHILDREN 20 | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install -y \ | ||
libjpeg62-turbo-dev \ | ||
libpng-dev \ | ||
libzip-dev \ | ||
libgmp-dev \ | ||
re2c \ | ||
libmhash-dev \ | ||
libmcrypt-dev \ | ||
file \ | ||
libxrender1 \ | ||
libfontconfig1 \ | ||
libfreetype6 | ||
COPY --chown=application:application . . | ||
RUN mv start.sh /opt/docker/provision/entrypoint.d/ | ||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
COPY user.ini $PHP_INI_DIR/conf.d/ | ||
RUN composer install | ||
EXPOSE 80 |
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
role=${CONTAINER_ROLE:-app} | ||
env=${APP_ENV:-production} | ||
|
||
echo "Running container role \"$role\" in \"$env\" environment. " | ||
|
||
php /app/artisan config:cache | ||
|
||
if [ "$role" = "app" ]; then | ||
|
||
if [ "$env" = "production" ]; then | ||
php /app/artisan migrate --force | ||
else | ||
php /app/artisan migrate | ||
fi | ||
|
||
elif [ "$role" = "queue" ]; then | ||
|
||
echo "Starting the queues..." | ||
mv queue.conf /opt/docker/etc/supervisor.d/ | ||
supervisorctl start queue-default queue-admin | ||
supervisorctl status all | ||
|
||
elif [ "$role" = "schedule" ]; then | ||
|
||
while [ true ]; do | ||
php /app/artisan schedule:run --verbose --no-interaction & | ||
sleep 60 | ||
done | ||
|
||
else | ||
|
||
echo "Could not match the container role \"$role\"" | ||
exit 1 | ||
|
||
fi |
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,2 @@ | ||
post_max_size = 256M | ||
upload_max_filesize = 128M |