diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..bf65b85 --- /dev/null +++ b/.dockerignore @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..abea909 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 517846d..e4c22fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 55b1129..2d8160c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: {} diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..136c564 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,7 @@ + diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro index 7b242df..5719c13 100644 --- a/src/layouts/DashboardLayout.astro +++ b/src/layouts/DashboardLayout.astro @@ -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 {title} - -
+ +
-
+
+