First image deployment
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m46s
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m46s
This commit is contained in:
29
.dockerignore
Normal file
29
.dockerignore
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# build output
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# generated types
|
||||||
|
.astro/
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# logs
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# environment variables
|
||||||
|
.env
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# macOS-specific files
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# jetbrains setting folder
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# database files (will be mounted as volume)
|
||||||
|
*.db
|
||||||
|
*.db-shm
|
||||||
|
*.db-wal
|
||||||
35
.github/workflows/deploy.yml
vendored
Normal file
35
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Docker Deploy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REPO_HOST }}
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||||
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
@@ -21,9 +21,11 @@ COPY package.json pnpm-lock.yaml ./
|
|||||||
|
|
||||||
RUN pnpm install --prod
|
RUN pnpm install --prod
|
||||||
|
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV PORT=4321
|
ENV PORT=4321
|
||||||
ENV DATABASE_URL=chronus.db
|
ENV DATABASE_URL=/app/data/chronus.db
|
||||||
EXPOSE 4321
|
EXPOSE 4321
|
||||||
|
|
||||||
CMD ["node", "./dist/server/entry.mjs"]
|
CMD ["node", "./dist/server/entry.mjs"]
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
services:
|
services:
|
||||||
chronus:
|
chronus:
|
||||||
build: .
|
image: ${IMAGE}
|
||||||
ports:
|
ports:
|
||||||
- "4321:4321"
|
- ${APP_PORT}:4321
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
- NODE_ENV=production
|
||||||
HOST: 0.0.0.0
|
- HOST=0.0.0.0
|
||||||
PORT: 4321
|
- PORT=4321
|
||||||
DATABASE_URL: /app/data/chronus.db
|
- DATABASE_URL=/app/data/chronus.db
|
||||||
volumes:
|
volumes:
|
||||||
- chronus_data:/app/data
|
- ${ROOT_DIR}:/app/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks: {}
|
||||||
volumes:
|
|
||||||
chronus_data:
|
|
||||||
|
|||||||
7
src/components/Footer.astro
Normal file
7
src/components/Footer.astro
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<footer class="footer footer-center p-4 bg-base-200 text-base-content border-t border-base-300">
|
||||||
|
<aside>
|
||||||
|
<p class="text-sm">
|
||||||
|
Made with <span class="text-red-500">❤️</span> by <a href="https://github.com/atridad" target="_blank" rel="noopener noreferrer" class="link link-hover font-semibold">Atridad Lahiji</a>
|
||||||
|
</p>
|
||||||
|
</aside>
|
||||||
|
</footer>
|
||||||
@@ -4,6 +4,7 @@ import { Icon } from 'astro-icon/components';
|
|||||||
import { db } from '../db';
|
import { db } from '../db';
|
||||||
import { members, organizations } from '../db/schema';
|
import { members, organizations } from '../db/schema';
|
||||||
import { eq } from 'drizzle-orm';
|
import { eq } from 'drizzle-orm';
|
||||||
|
import Footer from '../components/Footer.astro';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -41,10 +42,10 @@ const currentTeam = userMemberships.find(m => m.organization.id === currentTeamI
|
|||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-linear-to-br from-base-100 via-base-200 to-base-100">
|
<body class="bg-linear-to-br from-base-100 via-base-200 to-base-100 h-screen flex flex-col overflow-hidden">
|
||||||
<div class="drawer lg:drawer-open">
|
<div class="drawer lg:drawer-open flex-1 overflow-auto">
|
||||||
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
|
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
|
||||||
<div class="drawer-content flex flex-col">
|
<div class="drawer-content flex flex-col h-full overflow-auto">
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<div class="navbar bg-base-100 sticky top-0 z-50 lg:hidden border-b border-base-300">
|
<div class="navbar bg-base-100 sticky top-0 z-50 lg:hidden border-b border-base-300">
|
||||||
<div class="flex-none lg:hidden">
|
<div class="flex-none lg:hidden">
|
||||||
@@ -167,5 +168,6 @@ const currentTeam = userMemberships.find(m => m.organization.id === currentTeamI
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Footer />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import '../styles/global.css';
|
import '../styles/global.css';
|
||||||
|
import Footer from '../components/Footer.astro';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -18,7 +19,10 @@ const { title } = Astro.props;
|
|||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="min-h-screen bg-base-100 text-base-content">
|
<body class="h-screen bg-base-100 text-base-content flex flex-col overflow-auto">
|
||||||
<slot />
|
<div class="flex-1 overflow-auto">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
<Footer />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if (Astro.locals.user) {
|
|||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Chronus - Time Tracking">
|
<Layout title="Chronus - Time Tracking">
|
||||||
<div class="hero min-h-screen bg-linear-to-br from-base-100 via-base-200 to-base-300">
|
<div class="hero h-full bg-linear-to-br from-base-100 via-base-200 to-base-300 flex items-center justify-center py-12">
|
||||||
<div class="hero-content text-center">
|
<div class="hero-content text-center">
|
||||||
<div class="max-w-4xl">
|
<div class="max-w-4xl">
|
||||||
<img src="/src/assets/logo.webp" alt="Chronus Logo" class="h-24 w-24 mx-auto mb-6" />
|
<img src="/src/assets/logo.webp" alt="Chronus Logo" class="h-24 w-24 mx-auto mb-6" />
|
||||||
|
|||||||
Reference in New Issue
Block a user