This commit is contained in:
Andras Bacsai
2024-09-12 21:16:08 +02:00
parent 0b33315991
commit 786b6f11b2
9 changed files with 46 additions and 26 deletions

View File

@@ -3,11 +3,15 @@ services:
build:
context: .
dockerfile: ./docker/dev/Dockerfile
args:
USER_ID: "${USERID:-9999}"
GROUP_ID: "${GROUPID:-9999}"
ports:
- "${APP_PORT:-8000}:80"
- "8000:8080"
environment:
PUID: "${USERID:-1000}"
PGID: "${GROUPID:-1000}"
PHP_OPCACHE_ENABLE: 1
USER_ID: "${USERID:-9999}"
GROUP_ID: "${GROUPID:-9999}"
SSL_MODE: "off"
AUTORUN_LARAVEL_STORAGE_LINK: "false"
AUTORUN_LARAVEL_MIGRATION: "false"

View File

@@ -87,7 +87,7 @@ services:
soketi:
condition: service_healthy
postgres:
volumes:
volumes:
- coolify-db:/var/lib/postgresql/data
environment:
POSTGRES_USER: "${DB_USERNAME}"

View File

@@ -1,6 +1,9 @@
FROM serversideup/php:8.2-fpm-nginx-v2.2.1
FROM serversideup/php:8.3-fpm-nginx
USER root
ARG TARGETPLATFORM
ARG USER_ID
ARG GROUP_ID
# https://github.com/cloudflare/cloudflared/releases
ARG CLOUDFLARED_VERSION=2024.4.1
@@ -16,7 +19,7 @@ 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 install -y 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 --chmod=755 docker/dev/etc/s6-overlay/ /etc/s6-overlay/
@@ -40,7 +43,12 @@ RUN /bin/bash -c "if [[ ${TARGETPLATFORM} == 'linux/arm64' ]]; then \
COPY --from=minio/mc:RELEASE.2024-09-09T07-53-10Z /usr/bin/mc /usr/bin/mc
RUN chmod +x /usr/bin/mc
RUN { \
echo 'upload_max_filesize=256M'; \
echo 'post_max_size=256M'; \
} > /etc/php/current_version/cli/conf.d/upload-limits.ini
# RUN { \
# echo 'upload_max_filesize=256M'; \
# echo 'post_max_size=256M'; \
# } > /etc/php/current_version/cli/conf.d/upload-limits.ini
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID
RUN docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx
USER www-data

View File

@@ -1,5 +1,5 @@
#!/command/execlineb -P
foreground {
s6-sleep 5
su - webuser -c "php /var/www/html/artisan start:horizon"
php /var/www/html/artisan start:horizon
}

View File

@@ -1,5 +1,5 @@
#!/command/execlineb -P
foreground {
s6-sleep 5
su - webuser -c "php /var/www/html/artisan start:scheduler"
php /var/www/html/artisan start:scheduler
}

View File

@@ -1,4 +1,5 @@
FROM serversideup/php:8.2-fpm-nginx-v2.2.1 as base
FROM serversideup/php:8.3-fpm-nginx as base
USER root
WORKDIR /var/www/html
COPY composer.json composer.lock ./
@@ -11,8 +12,10 @@ 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
FROM serversideup/php:8.3-fpm-nginx
USER root
ARG USER_ID=9999
ARG GROUP_ID=9999
ARG TARGETPLATFORM
# https://github.com/cloudflare/cloudflared/releases
ARG CLOUDFLARED_VERSION=2024.4.1
@@ -64,10 +67,15 @@ RUN /bin/bash -c "if [[ ${TARGETPLATFORM} == 'linux/arm64' ]]; then \
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
# RUN { \
# echo 'upload_max_filesize=256M'; \
# echo 'post_max_size=256M'; \
# } > /etc/php/current_version/cli/conf.d/upload-limits.ini
COPY --from=minio/mc:RELEASE.2024-09-09T07-53-10Z /usr/bin/mc /usr/bin/mc
RUN chmod +x /usr/bin/mc
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID
RUN docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx
USER www-data

View File

@@ -1,5 +1,5 @@
#!/command/execlineb -P
foreground {
s6-sleep 5
su - webuser -c "php /var/www/html/artisan start:horizon"
php /var/www/html/artisan start:horizon
}

View File

@@ -1,5 +1,5 @@
#!/command/execlineb -P
foreground {
s6-sleep 5
su - webuser -c "php /var/www/html/artisan start:scheduler"
php /var/www/html/artisan start:scheduler
}

View File

@@ -62,10 +62,10 @@ function sync:bunny {
# }
function db:reset {
bash spin exec -u webuser coolify php artisan migrate:fresh --seed
bash spin exec coolify php artisan migrate:fresh --seed
}
function db:reset-prod {
bash spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||
bash spin exec coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||
php artisan migrate:fresh --force --seed --seeder=ProductionSeeder
}
@@ -74,11 +74,11 @@ function mfs {
}
function coolify {
bash spin exec -u webuser coolify bash
bash spin exec coolify bash
}
function coolify:root {
bash spin exec coolify bash
bash spin exec -u root coolify bash
}
function coolify:proxy {
docker exec -ti coolify-proxy sh
@@ -93,7 +93,7 @@ function vite {
}
function tinker {
bash spin exec -u webuser coolify php artisan tinker
bash spin exec coolify php artisan tinker
}
# function build:helper {