chore: rename docker dirs
This commit is contained in:
69
docker/prod/Dockerfile
Normal file
69
docker/prod/Dockerfile
Normal file
@@ -0,0 +1,69 @@
|
||||
FROM serversideup/php:8.2-fpm-nginx-v2.2.1 as base
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY composer.json composer.lock ./
|
||||
RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist
|
||||
|
||||
FROM node:20 as static-assets
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
COPY --from=base --chown=9999:9999 /var/www/html .
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
FROM serversideup/php:8.2-fpm-nginx-v2.2.1
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
# https://github.com/cloudflare/cloudflared/releases
|
||||
ARG CLOUDFLARED_VERSION=2024.4.1
|
||||
ARG POSTGRES_VERSION=15
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
RUN apt-get update
|
||||
# Postgres version requirements
|
||||
RUN apt install dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https curl -y
|
||||
RUN curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/postgresql.gpg > /dev/null
|
||||
|
||||
RUN echo deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main | tee -a /etc/apt/sources.list.d/postgresql.list
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install postgresql-client-$POSTGRES_VERSION -y
|
||||
|
||||
# Coolify requirements
|
||||
RUN apt-get install -y php8.2-pgsql openssh-client git git-lfs jq lsof
|
||||
RUN apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
|
||||
|
||||
COPY docker/prod/nginx.conf /etc/nginx/conf.d/custom.conf
|
||||
|
||||
COPY --from=base --chown=9999:9999 /var/www/html .
|
||||
|
||||
COPY --chown=9999:9999 . .
|
||||
RUN composer dump-autoload
|
||||
|
||||
COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build
|
||||
COPY --chmod=755 docker/prod/etc/s6-overlay/ /etc/s6-overlay/
|
||||
|
||||
RUN php artisan route:cache
|
||||
RUN php artisan view:cache
|
||||
|
||||
RUN echo "alias ll='ls -al'" >>/etc/bash.bashrc
|
||||
RUN echo "alias a='php artisan'" >>/etc/bash.bashrc
|
||||
RUN echo "alias logs='tail -f storage/logs/laravel.log'" >>/etc/bash.bashrc
|
||||
|
||||
RUN mkdir -p /usr/local/bin
|
||||
|
||||
RUN /bin/bash -c "if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \
|
||||
echo 'amd64' && \
|
||||
curl -sSL https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-amd64 -o /usr/local/bin/cloudflared && chmod +x /usr/local/bin/cloudflared \
|
||||
;fi"
|
||||
|
||||
RUN /bin/bash -c "if [[ ${TARGETPLATFORM} == 'linux/arm64' ]]; then \
|
||||
echo 'arm64' && \
|
||||
curl -L https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-arm64 -o /usr/local/bin/cloudflared && chmod +x /usr/local/bin/cloudflared \
|
||||
;fi"
|
||||
|
||||
RUN { \
|
||||
echo 'upload_max_filesize=256M'; \
|
||||
echo 'post_max_size=256M'; \
|
||||
} > /etc/php/current_version/cli/conf.d/upload-limits.ini
|
||||
1
docker/prod/etc/s6-overlay/s6-rc.d/db-migration/type
Normal file
1
docker/prod/etc/s6-overlay/s6-rc.d/db-migration/type
Normal file
@@ -0,0 +1 @@
|
||||
oneshot
|
||||
2
docker/prod/etc/s6-overlay/s6-rc.d/db-migration/up
Normal file
2
docker/prod/etc/s6-overlay/s6-rc.d/db-migration/up
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/command/execlineb -P
|
||||
php /var/www/html/artisan migrate --force --isolated
|
||||
5
docker/prod/etc/s6-overlay/s6-rc.d/horizon/run
Normal file
5
docker/prod/etc/s6-overlay/s6-rc.d/horizon/run
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/command/execlineb -P
|
||||
foreground {
|
||||
s6-sleep 5
|
||||
su - webuser -c "php /var/www/html/artisan start:horizon"
|
||||
}
|
||||
1
docker/prod/etc/s6-overlay/s6-rc.d/horizon/type
Normal file
1
docker/prod/etc/s6-overlay/s6-rc.d/horizon/type
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
||||
1
docker/prod/etc/s6-overlay/s6-rc.d/init-script/type
Normal file
1
docker/prod/etc/s6-overlay/s6-rc.d/init-script/type
Normal file
@@ -0,0 +1 @@
|
||||
oneshot
|
||||
3
docker/prod/etc/s6-overlay/s6-rc.d/init-script/up
Normal file
3
docker/prod/etc/s6-overlay/s6-rc.d/init-script/up
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/command/execlineb -P
|
||||
s6-setuidgid webuser
|
||||
php /var/www/html/artisan app:init --full-cleanup
|
||||
1
docker/prod/etc/s6-overlay/s6-rc.d/init-seeder/type
Normal file
1
docker/prod/etc/s6-overlay/s6-rc.d/init-seeder/type
Normal file
@@ -0,0 +1 @@
|
||||
oneshot
|
||||
2
docker/prod/etc/s6-overlay/s6-rc.d/init-seeder/up
Normal file
2
docker/prod/etc/s6-overlay/s6-rc.d/init-seeder/up
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/command/execlineb -P
|
||||
php /var/www/html/artisan db:seed --class ProductionSeeder --force
|
||||
5
docker/prod/etc/s6-overlay/s6-rc.d/scheduler-worker/run
Normal file
5
docker/prod/etc/s6-overlay/s6-rc.d/scheduler-worker/run
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/command/execlineb -P
|
||||
foreground {
|
||||
s6-sleep 5
|
||||
su - webuser -c "php /var/www/html/artisan start:scheduler"
|
||||
}
|
||||
1
docker/prod/etc/s6-overlay/s6-rc.d/scheduler-worker/type
Normal file
1
docker/prod/etc/s6-overlay/s6-rc.d/scheduler-worker/type
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
||||
4
docker/prod/nginx.conf
Normal file
4
docker/prod/nginx.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
# Custom nginx configuration
|
||||
|
||||
# Disable access logs
|
||||
access_log off;
|
||||
Reference in New Issue
Block a user