fix: COPY init.sql into DB image, remove Next.js basePath for Traefik prefix stripping

This commit is contained in:
Monarch055
2026-06-11 09:43:16 +07:00
parent 7e373a28a1
commit 42f06c1128
5 changed files with 20 additions and 13 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: '/sistem-km-next',
/* config options here */
// basePath removed: Coolify's Traefik strips the /sistem-km-next prefix before
// forwarding to this container, so Next.js must respond at root /.
// The Traefik path /sistem-km-next -> container / mapping handles routing.
};
export default nextConfig;
+5 -5
View File
@@ -111,7 +111,7 @@ export default function Dashboard() {
const fetchUsers = async () => {
try {
const res = await fetch('/sistem-km-next/api/users');
const res = await fetch('/api/users');
if (res.ok) {
const data = await res.json();
setUsersList(data.users || []);
@@ -123,7 +123,7 @@ export default function Dashboard() {
e.preventDefault();
setIsSubmittingUser(true);
try {
const res = await fetch('/sistem-km-next/api/users', {
const res = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(userFormData)
@@ -149,7 +149,7 @@ export default function Dashboard() {
onConfirm: async () => {
setConfirmDialog(null);
try {
const res = await fetch(`/sistem-km-next/api/users?id=${id}`, { method: 'DELETE' });
const res = await fetch(`/api/users?id=${id}`, { method: 'DELETE' });
if (res.ok) {
showToastNotification('Pengguna berhasil dihapus!');
fetchUsers();
@@ -171,7 +171,7 @@ export default function Dashboard() {
onConfirm: async () => {
setConfirmDialog(null);
try {
const res = await fetch(`/sistem-km-next/api/hubs?id=${id}`, { method: 'DELETE' });
const res = await fetch(`/api/hubs?id=${id}`, { method: 'DELETE' });
if (res.ok) {
showToastNotification('Rumah ibadah dan akun terikat berhasil dihapus!');
fetchData();
@@ -541,7 +541,7 @@ const [isEditMode, setIsEditMode] = useState(false);
setHouseholds(formattedHh);
} else {
setHouseholds([]);
fetch('/sistem-km-next/api/stats')
fetch('/api/stats')
.then(res => res.json())
.then(data => {
if (!isMountedRef.current) return;