Update 4 files

- /.gitignore
- /Dockerfile
- /docker-compose.yml
- /.gitlab-ci.yml
This commit is contained in:
Muhammad Alfin Afif Al Farizi Farham 2026-02-04 09:50:10 +07:00
parent c6b7f6c6a4
commit 151ea8d58a
4 changed files with 33 additions and 22 deletions

1
.gitignore vendored
View File

@ -13,7 +13,6 @@
/.zed
/auth.json
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key

View File

@ -31,6 +31,6 @@ deploy:
- echo -e "$ENV_FILE" > .env
script:
- docker compose down || true
- docker compose up -d --build
- docker compose up -d
only:
- main

View File

@ -1,10 +1,27 @@
FROM dunglas/frankenphp:1-php8.3
ENV SERVER_NAME=":80"
### ===============================
### STAGE 1: FRONTEND BUILD
### ===============================
FROM node:20-alpine AS frontend
WORKDIR /app
# System dependencies
COPY package*.json ./
RUN npm install
COPY resources resources
COPY vite.config.* .
RUN npm run build
### ===============================
### STAGE 2: PHP / LARAVEL
### ===============================
FROM dunglas/frankenphp:1-php8.3
ENV SERVER_NAME=":80"
WORKDIR /app
# System deps
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
@ -14,24 +31,22 @@ RUN apt-get update && apt-get install -y \
pkg-config \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install \
gd \
pdo \
pdo_mysql \
zip \
bcmath \
intl \
exif \
gd pdo pdo_mysql zip bcmath intl exif \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy composer files first (cache friendly)
# Composer
COPY composer.json composer.lock ./
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer install --no-dev --optimize-autoloader --no-interaction
RUN composer install --no-dev --optimize-autoloader --no-interaction --no-scripts
# Copy source code terakhir
# App source
COPY . .
RUN composer clear-cache
# COPY HASIL VITE BUILD
COPY --from=frontend /app/public/build public/build
RUN php artisan config:clear \
&& php artisan view:clear \
&& php artisan route:clear

View File

@ -1,11 +1,8 @@
services:
app:
build:
context: .
image: purwakarta-diskominfo-simedkom-new:v1.0.0
# command: >
# sh -c "echo 'max_execution_time=300' > /usr/local/etc/php/conf.d/custom.ini && php artisan storage:link && pap artisan optimize:clear && php-fpm"
container_name: purwakarta-diskominfo-simedkom-new
ports:
- "8103:80"