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 /.zed
/auth.json /auth.json
/node_modules /node_modules
/public/build
/public/hot /public/hot
/public/storage /public/storage
/storage/*.key /storage/*.key

View File

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

View File

@ -1,10 +1,27 @@
FROM dunglas/frankenphp:1-php8.3 ### ===============================
### STAGE 1: FRONTEND BUILD
ENV SERVER_NAME=":80" ### ===============================
FROM node:20-alpine AS frontend
WORKDIR /app 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 \ RUN apt-get update && apt-get install -y \
libpng-dev \ libpng-dev \
libjpeg-dev \ libjpeg-dev \
@ -14,24 +31,22 @@ RUN apt-get update && apt-get install -y \
pkg-config \ pkg-config \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install \ && docker-php-ext-install \
gd \ gd pdo pdo_mysql zip bcmath intl exif \
pdo \
pdo_mysql \
zip \
bcmath \
intl \
exif \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copy composer files first (cache friendly) # Composer
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 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 # App source
# Copy source code terakhir
COPY . . 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: services:
app: app:
build:
context: .
image: purwakarta-diskominfo-simedkom-new:v1.0.0 image: purwakarta-diskominfo-simedkom-new:v1.0.0
# command: > # 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" # 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 container_name: purwakarta-diskominfo-simedkom-new
ports: ports:
- "8103:80" - "8103:80"