This commit is contained in:
parent
0647f28db1
commit
e718733a31
@ -33,6 +33,10 @@ steps:
|
||||
from_secret: registry_username
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry_password
|
||||
GIT_USERNAME:
|
||||
from_secret: git_username
|
||||
GIT_ACCESS_TOKEN:
|
||||
from_secret: git_token
|
||||
commands:
|
||||
- apt-get update -qq && apt-get install -qq git openssh-client
|
||||
- mkdir -p ~/.ssh
|
||||
@ -48,6 +52,8 @@ steps:
|
||||
ssh -i ~/.ssh/id_rsa opc@138.2.102.242 <<EOF
|
||||
docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD registry.git.appstaging.my.id
|
||||
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 image prune --all --force
|
||||
docker pull registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev
|
||||
|
||||
39
Dockerfile
39
Dockerfile
@ -1,27 +1,40 @@
|
||||
FROM php:8.3-fpm
|
||||
|
||||
# Install dependencies & extensions
|
||||
# Install system dependencies & PHP extensions
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libzip-dev unzip git libpq-dev libicu-dev zip curl \
|
||||
&& docker-php-ext-install intl zip pdo_pgsql bcmath
|
||||
libzip-dev \
|
||||
unzip \
|
||||
git \
|
||||
libpq-dev \
|
||||
libicu-dev \
|
||||
zip \
|
||||
curl \
|
||||
&& docker-php-ext-install \
|
||||
intl \
|
||||
zip \
|
||||
pdo_pgsql \
|
||||
bcmath
|
||||
|
||||
# Install Composer
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www
|
||||
|
||||
# Copy project files including entrypoint.sh
|
||||
# Copy source
|
||||
COPY . .
|
||||
COPY .env.example .env
|
||||
|
||||
# Beri permission executable ke entrypoint.sh
|
||||
RUN chmod +x /var/www/entrypoint.sh
|
||||
# Install dependencies
|
||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
# Set permissions folder storage dan cache
|
||||
RUN mkdir -p storage/framework/{cache,sessions,views} bootstrap/cache && \
|
||||
chown -R www-data:www-data storage bootstrap/cache && \
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
# Generate app key
|
||||
RUN php artisan key:generate
|
||||
|
||||
# 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
|
||||
|
||||
# Set entrypoint
|
||||
ENTRYPOINT ["/var/www/entrypoint.sh"]
|
||||
CMD ["php-fpm"]
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user