Init New flavor

twopenny
ajikamaludin 2 years ago
parent ef60d3f5fb
commit 8672123ef0

@ -0,0 +1,39 @@
FROM php:8.1-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
zip \
unzip \
libpq-dev \
libgmp-dev \
vim-nox \
iputils-ping
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo mysqli pdo_mysql mbstring exif pcntl bcmath gd intl zip pgsql pdo_pgsql
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory
WORKDIR /var/www
USER $user

1093
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,22 @@
server {
listen 80;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/public;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}

@ -0,0 +1,47 @@
version: "3.7"
services:
app:
build:
args:
user: aji
uid: 1000
context: ./
dockerfile: ./Dockerfile
image: monitordoc
container_name: monitordoc-app
working_dir: /var/www/
volumes:
- ./:/var/www
- ./user.ini:/usr/local/etc/php/php.ini
networks:
- monitordoc
nginx:
image: nginx:1.17-alpine
container_name: monitordoc-nginx
ports:
- 8000:80
volumes:
- ./:/var/www
- ./default.conf:/etc/nginx/conf.d/default.conf
networks:
- monitordoc
monitordocdb:
image: mariadb:latest
container_name: monitordocdb
ports:
- 3306:3306
volumes:
- ./database:/database
environment:
MYSQL_ROOT_PASSWORD: password
networks:
monitordoc:
ipv4_address: 10.4.0.99
networks:
monitordoc:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.4.0.0/24
gateway: 10.4.0.1

@ -0,0 +1,30 @@
import React from 'react';
import { Link } from '@inertiajs/inertia-react';
export function NavItem({ href, active, children }) {
return (
<Link
href={href}
className={`btn btn-ghost rounded-btn ${active ? 'btn-active' : ''}`}
>
{children}
</Link>
);
}
export function NavDropdown({ name, items }) {
const active = items.find(act => act.route === route().current())
return (
<div className="dropdown">
<label tabIndex={0} className={`btn btn-ghost rounded-btn ${active ? 'btn-active' : ''}`}>{name}</label>
<ul tabIndex={0} className="menu dropdown-content p-2 shadow bg-base-100 rounded-box w-52 mt-4">
{items.map((item, index) => (
<li key={index}>
<Link href={route(item.route)}>{item.label}{route}</Link>
</li>
))}
</ul>
</div>
)
}

@ -3,10 +3,12 @@ import ApplicationLogo from '@/Components/ApplicationLogo';
import Dropdown from '@/Components/Dropdown';
import { ToastContainer, toast } from 'react-toastify'
import ResponsiveNavLink from '@/Components/ResponsiveNavLink';
import NavLink from '@/Components/NavLink';
import { Link } from '@inertiajs/inertia-react';
import MenuItem from '@/Components/SidebarMenuItem';
import { IconBell, IconBellRing } from '@/Icons';
import { Inertia } from '@inertiajs/inertia';
import { NavDropdown, NavItem } from '@/Components/NavItem';
const Notification = ({ notifications, hasUnread }) => {
const redirect = (item) => {
@ -51,96 +53,56 @@ export default function Authenticated({ auth, children, flash, notify }) {
return (
<div className="min-h-screen bg-base-200 pb-10">
<nav className="bg-base-100 border-b border-base-100">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between h-16">
<div className="flex">
<div className="shrink-0 flex items-center">
<Link href="/">
<ApplicationLogo className="font-bold text-3xl block h-9 w-auto" />
</Link>
</div>
{/* <div className="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
<NavLink href={route('dashboard')} active={route().current('dashboard')}>
Dashboard
</NavLink>
</div> */}
<div className="navbar bg-base-100 rounded-box max-w-7xl m-auto px-6">
<div className="px-2">
<a className="text-xl font-bold">Monitor Doc</a>
</div>
<div className="sm:flex flex-1 px-6 hidden">
<div className="flex items-stretch">
<NavItem href={route("dashboard")} active={route().current('dashboard')}>
Dashboard
</NavItem>
<NavDropdown
name="Dokumen"
items={[
{label: "Dokumen", route: 'docs.index'},
{label: "User", route: 'users.index'},
]}
></NavDropdown>
<NavItem href={route("users.index")} active={route().current('users.*')}>
User
</NavItem>
</div>
<div className="hidden sm:flex sm:items-center sm:ml-6">
<div className="ml-3 relative">
<Notification
notifications={notify.notifications}
hasUnread={+notify.notification_has_unread > 0 ? true : false}
</div>
<div className="sm:flex justify-end flex-1 px-2 hidden">
{auth.user.name}
</div>
<div className="flex-1 justify-end items-center sm:hidden">
<button
onClick={() => setShowingNavigationDropdown((previousState) => !previousState)}
className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
>
<svg className="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path
className={!showingNavigationDropdown ? 'inline-flex' : 'hidden'}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</div>
<div className="ml-3 relative">
<Dropdown>
<Dropdown.Trigger>
<span className="inline-flex rounded-md">
<button
type="button"
className="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md bg-base-100 focus:outline-none transition ease-in-out duration-150"
>
{auth.user.name}
<svg
className="ml-2 -mr-0.5 h-4 w-4"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fillRule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clipRule="evenodd"
/>
</svg>
</button>
</span>
</Dropdown.Trigger>
<Dropdown.Content width='w-42'>
<Dropdown.Link href={route('logout')} method="post" as="button">
Log Out
</Dropdown.Link>
</Dropdown.Content>
</Dropdown>
</div>
</div>
<div className="-mr-20 flex items-center sm:hidden">
<Notification
notifications={notify.notifications}
hasUnread={+notify.notification_has_unread > 0 ? true : false}
/>
</div>
<div className="-mr-2 flex items-center sm:hidden">
<button
onClick={() => setShowingNavigationDropdown((previousState) => !previousState)}
className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
>
<svg className="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path
className={!showingNavigationDropdown ? 'inline-flex' : 'hidden'}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4 6h16M4 12h16M4 18h16"
/>
<path
className={showingNavigationDropdown ? 'inline-flex' : 'hidden'}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
<path
className={showingNavigationDropdown ? 'inline-flex' : 'hidden'}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
</div>
<div className={(showingNavigationDropdown ? 'block' : 'hidden') + ' sm:hidden'}>
<div className="pt-2 pb-3 space-y-1">
<ResponsiveNavLink href={route('dashboard')} active={route().current('dashboard')}>
@ -168,21 +130,7 @@ export default function Authenticated({ auth, children, flash, notify }) {
</div>
</div>
</nav>
<div className='flex flex-row md:mt-5 max-w-7xl mx-auto'>
<div className='w-auto hidden md:block'>
<aside className="ml-5 w-64" aria-label="Sidebar">
<div className="overflow-y-auto py-4 px-3 bg-base-100 rounded">
<ul className="space-y-2">
<MenuItem routeName='dashboard' active='dashboard' name='Dashboard' />
<MenuItem routeName='docs.index' active='docs.*' name='Monitoring' />
{auth.user.is_admin === 1 && (
<MenuItem routeName='users.index' active='users.*' name='Users' />
)}
</ul>
</div>
</aside>
</div>
<div className='w-full pt-5 md:pt-0'>
<main>{children}</main>

Loading…
Cancel
Save