First image deployment
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m46s

This commit is contained in:
2026-01-16 15:15:13 -07:00
parent 64717319cc
commit 38fe0ea9ce
8 changed files with 94 additions and 17 deletions

29
.dockerignore Normal file
View 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
View 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

View File

@@ -21,9 +21,11 @@ COPY package.json pnpm-lock.yaml ./
RUN pnpm install --prod
RUN mkdir -p /app/data
ENV HOST=0.0.0.0
ENV PORT=4321
ENV DATABASE_URL=chronus.db
ENV DATABASE_URL=/app/data/chronus.db
EXPOSE 4321
CMD ["node", "./dist/server/entry.mjs"]

View File

@@ -1,16 +1,14 @@
services:
chronus:
build: .
image: ${IMAGE}
ports:
- "4321:4321"
- ${APP_PORT}:4321
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 4321
DATABASE_URL: /app/data/chronus.db
- NODE_ENV=production
- HOST=0.0.0.0
- PORT=4321
- DATABASE_URL=/app/data/chronus.db
volumes:
- chronus_data:/app/data
- ${ROOT_DIR}:/app/data
restart: unless-stopped
volumes:
chronus_data:
networks: {}

View 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>

View File

@@ -4,6 +4,7 @@ import { Icon } from 'astro-icon/components';
import { db } from '../db';
import { members, organizations } from '../db/schema';
import { eq } from 'drizzle-orm';
import Footer from '../components/Footer.astro';
interface Props {
title: string;
@@ -41,10 +42,10 @@ const currentTeam = userMemberships.find(m => m.organization.id === currentTeamI
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body class="bg-linear-to-br from-base-100 via-base-200 to-base-100">
<div class="drawer lg:drawer-open">
<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 flex-1 overflow-auto">
<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 -->
<div class="navbar bg-base-100 sticky top-0 z-50 lg:hidden border-b border-base-300">
<div class="flex-none lg:hidden">
@@ -167,5 +168,6 @@ const currentTeam = userMemberships.find(m => m.organization.id === currentTeamI
</div>
</div>
<Footer />
</body>
</html>

View File

@@ -1,5 +1,6 @@
---
import '../styles/global.css';
import Footer from '../components/Footer.astro';
interface Props {
title: string;
@@ -18,7 +19,10 @@ const { title } = Astro.props;
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</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">
<div class="flex-1 overflow-auto">
<slot />
</div>
<Footer />
</body>
</html>

View File

@@ -7,7 +7,7 @@ if (Astro.locals.user) {
---
<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="max-w-4xl">
<img src="/src/assets/logo.webp" alt="Chronus Logo" class="h-24 w-24 mx-auto mb-6" />