Files
spota-dev/DOCKER.md
Power BI Dev 874dbbe8e8 Add Docker and Coolify deployment setup
Add the container configuration, environment templates, and storage settings needed to deploy SPOTA with Docker and Coolify.
2026-05-02 10:07:56 +07:00

75 lines
1.6 KiB
Markdown

# SPOTA Docker
Setup ini menjalankan aplikasi legacy SPOTA dengan PHP 7.4 Apache dan MySQL 8 dalam satu `docker-compose.yml`.
## Jalankan Lokal
```powershell
copy .env.example .env
docker compose up -d --build
```
Akses aplikasi:
```text
http://localhost:8080
http://localhost:8080/admin/login.php
http://localhost:8080/dosen/login.php
http://localhost:8080/mahasiswa/login.php
```
## Stop
```powershell
docker compose down
```
## Reset Database
Perintah ini menghapus volume DB dan import ulang dump dari `spota_db`.
```powershell
docker compose down -v
docker compose up -d
```
## Database
Dump diambil dari folder `spota_db` saat volume DB pertama kali dibuat.
Database yang di-import:
- `spota_spotadb`
- `spota_konsultasi`
- `spota_doxid`
- `spota_rek_artikel`
## Volume/Data
Folder berikut di-mount dari host supaya data upload tidak masuk image:
- `./files:/var/www/html/files`
- `./img:/var/www/html/img`
Opsional, upload berkas bisa dipindah ke lokasi di luar folder project dengan environment variable:
- `FILES_STORAGE_PATH=/absolute/path/to/files`
Jika `FILES_STORAGE_PATH` tidak diisi, aplikasi tetap memakai default `files/` di dalam document root.
Folder target akan dibuat otomatis saat upload pertama.
Jika path tersebut berada di luar `/var/www/html/files`, sesuaikan juga volume mount container ke lokasi yang sama.
Untuk Coolify, jadikan path ini persistent storage.
## Coolify
Sesuaikan environment berikut di Coolify:
- `APP_URL`
- `DB_USER`
- `DB_PASSWORD`
- `MYSQL_ROOT_PASSWORD`
- `PHP_DISPLAY_ERRORS=0` untuk production
Port internal app adalah `80`. Database internal memakai service name `db` pada port `3306`.