-
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
3136de7
commit 2beabf3
Showing
32 changed files
with
65 additions
and
60 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Build and Push Docker Image | |
on: | ||
push: | ||
branches: | ||
- "7.4" | ||
- "7.4-s6" | ||
|
||
jobs: | ||
build-and-push: | ||
|
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,6 +1,11 @@ | ||
FROM alpine:3.14 | ||
LABEL MAINTAINER "Rakshit Menpara <[email protected]>" | ||
|
||
ARG S6_OVERLAY_VERSION="3.1.5.0" | ||
ARG S6_OVERLAY_ARCH="x86_64" | ||
|
||
ENV UID=100 \ | ||
GID=101 \ | ||
FPM_LOG_LEVEL=warning | ||
ENV composer_hash 48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5 | ||
ENV DOCKERIZE_VERSION v0.6.1 | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
|
@@ -26,15 +31,14 @@ RUN set -ex \ | |
# Other dependencies | ||
mariadb-client sudo \ | ||
# Miscellaneous packages | ||
bash ca-certificates dialog git libjpeg libpng-dev openssh-client supervisor vim wget \ | ||
bash ca-certificates dialog git libjpeg libpng-dev openssh-client shadow vim wget \ | ||
# Nginx | ||
nginx \ | ||
# Create directories | ||
&& mkdir -p /etc/nginx \ | ||
&& mkdir -p /run/nginx \ | ||
&& mkdir -p /etc/nginx/sites-available \ | ||
&& mkdir -p /etc/nginx/sites-enabled \ | ||
&& mkdir -p /var/log/supervisor \ | ||
&& rm -Rf /var/www/* \ | ||
&& rm -Rf /etc/nginx/nginx.conf \ | ||
# Composer | ||
|
@@ -47,13 +51,27 @@ RUN set -ex \ | |
|
||
################## INSTALLATION ENDS ################## | ||
|
||
# add s6 overlay | ||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp | ||
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz | ||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp | ||
RUN tar -C / -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz | ||
|
||
# add s6 optional symlinks | ||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp | ||
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz | ||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp | ||
RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz | ||
|
||
################## CONFIGURATION STARTS ################## | ||
|
||
ADD rootfs / | ||
|
||
RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf && \ | ||
ln -s /etc/php7/php.ini /etc/php7/conf.d/php.ini && \ | ||
chown -R nginx:nginx /var/www && \ | ||
chmod 755 /etc/s6-overlay/s6-rc.d/*/run && \ | ||
chmod 755 /etc/s6-overlay/s6-rc.d/*/up && \ | ||
mkdir -p /var/www/storage/logs/ && \ | ||
touch /var/www/storage/logs/laravel.log /var/log/nginx/error.log /var/log/php7/error.log | ||
|
||
|
@@ -63,13 +81,4 @@ EXPOSE 443 80 | |
|
||
WORKDIR /var/www | ||
|
||
ENTRYPOINT ["dockerize", \ | ||
"-template", "/etc/php7/php.ini:/etc/php7/php.ini", \ | ||
"-template", "/etc/php7/php-fpm.conf:/etc/php7/php-fpm.conf", \ | ||
"-template", "/etc/php7/php-fpm.d:/etc/php7/php-fpm.d", \ | ||
"-stdout", "/var/www/storage/logs/laravel.log", \ | ||
"-stdout", "/var/log/nginx/error.log", \ | ||
"-stdout", "/var/log/php7/error.log", \ | ||
"-poll"] | ||
|
||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] | ||
ENTRYPOINT ["/init"] |
Empty file.
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 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
# copy default config files if they don't exist | ||
if [[ ! -f /etc/nginx/sites-enabled/default.conf ]]; then | ||
cp /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf | ||
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 @@ | ||
oneshot |
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 @@ | ||
/etc/s6-overlay/s6-rc.d/init-nginx/run |
Empty file.
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,5 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
# add environment variable into files | ||
dockerize -template /etc/php7/php.ini:/etc/php7/php.ini -template /etc/php7/php-fpm.conf:/etc/php7/php-fpm.conf -template /etc/php7/php-fpm.d:/etc/php7/php-fpm.d |
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 @@ | ||
oneshot |
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 @@ | ||
/etc/s6-overlay/s6-rc.d/init-php7-fpm/run |
Empty file.
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,8 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
UID=${UID:-911} | ||
GID=${GID:-911} | ||
|
||
echo "User Id $UID, Group id $GID" | ||
usermod -u "$UID" nginx && groupmod -g "$GID" nginx |
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 @@ | ||
oneshot |
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 @@ | ||
/etc/s6-overlay/s6-rc.d/init-usermod/run |
Empty file.
Empty file.
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 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
/usr/sbin/nginx -g "daemon off;" |
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 @@ | ||
longrun |
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 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
/usr/sbin/php-fpm7 --nodaemonize --fpm-config /etc/php7/php-fpm.conf |
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 @@ | ||
longrun |
Empty file.
Empty file.
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 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
dockerize -stdout /var/www/storage/logs/laravel.log -stdout /var/log/nginx/error.log -stdout /var/log/php7/error.log -poll |
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 @@ | ||
longrun |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "User Id $UID, Group id $GID" | ||
usermod -u "$UID" nginx && groupmod -g "$GID" nginx |