oks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Triono Putra 2025-05-28 16:24:02 +07:00
parent 0647f28db1
commit e718733a31
3 changed files with 32 additions and 28 deletions

View File

@ -33,6 +33,10 @@ steps:
from_secret: registry_username from_secret: registry_username
REGISTRY_PASSWORD: REGISTRY_PASSWORD:
from_secret: registry_password from_secret: registry_password
GIT_USERNAME:
from_secret: git_username
GIT_ACCESS_TOKEN:
from_secret: git_token
commands: commands:
- apt-get update -qq && apt-get install -qq git openssh-client - apt-get update -qq && apt-get install -qq git openssh-client
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
@ -48,6 +52,8 @@ steps:
ssh -i ~/.ssh/id_rsa opc@138.2.102.242 <<EOF ssh -i ~/.ssh/id_rsa opc@138.2.102.242 <<EOF
docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD registry.git.appstaging.my.id docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD registry.git.appstaging.my.id
cd /home/opc/workspace/sistem-akademik cd /home/opc/workspace/sistem-akademik
git checkout main
git pull https://$GIT_USERNAME:$GIT_ACCESS_TOKEN@git.appstaging.my.id/audydental/audy-dental-website-backend.git develop
docker-compose rm --stop --force sistem-akademik-dev docker-compose rm --stop --force sistem-akademik-dev
docker image prune --all --force docker image prune --all --force
docker pull registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev docker pull registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev

View File

@ -1,27 +1,40 @@
FROM php:8.3-fpm FROM php:8.3-fpm
# Install dependencies & extensions # Install system dependencies & PHP extensions
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libzip-dev unzip git libpq-dev libicu-dev zip curl \ libzip-dev \
&& docker-php-ext-install intl zip pdo_pgsql bcmath unzip \
git \
libpq-dev \
libicu-dev \
zip \
curl \
&& docker-php-ext-install \
intl \
zip \
pdo_pgsql \
bcmath
# Install Composer # Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www WORKDIR /var/www
# Copy project files including entrypoint.sh # Copy source
COPY . . COPY . .
COPY .env.example .env
# Beri permission executable ke entrypoint.sh # Install dependencies
RUN chmod +x /var/www/entrypoint.sh RUN composer install --no-interaction --prefer-dist --optimize-autoloader
# Set permissions folder storage dan cache # Generate app key
RUN mkdir -p storage/framework/{cache,sessions,views} bootstrap/cache && \ RUN php artisan key:generate
chown -R www-data:www-data storage bootstrap/cache && \
chmod -R 775 storage bootstrap/cache # Set permissions
RUN chown -R www-data:www-data /var/www \
&& chmod -R 775 storage bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache
EXPOSE 9000 EXPOSE 9000
CMD ["php-fpm"]
# Set entrypoint
ENTRYPOINT ["/var/www/entrypoint.sh"]

View File

@ -1,15 +0,0 @@
#!/bin/sh
# Install dependencies via composer (non-interactive)
composer install --no-interaction --prefer-dist --optimize-autoloader
# Cache config, routes, views
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Jalankan migration otomatis dengan force (untuk production)
php artisan migrate --force
# Jalankan php-fpm (foreground)
exec php-fpm -F