fix: repair docker build and apply migrations
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,10 +1,9 @@
|
||||
FROM node:22-alpine AS base
|
||||
RUN corepack enable pnpm
|
||||
FROM node:22-slim AS base
|
||||
RUN corepack enable
|
||||
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache python3 make g++
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM base AS build
|
||||
@@ -16,7 +15,5 @@ RUN pnpm build
|
||||
FROM base AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/.output ./.output
|
||||
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 3000
|
||||
CMD ["node", "./.output/server/index.mjs"]
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { TableColumn } from "@nuxt/ui";
|
||||
|
||||
const UBadge = resolveComponent("UBadge");
|
||||
|
||||
const props = defineProps<{
|
||||
defineProps<{
|
||||
data: Link[];
|
||||
status: "pending" | "idle" | "success" | "error";
|
||||
}>();
|
||||
|
||||
22
docker-compose.dev.yml
Normal file
22
docker-compose.dev.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
services:
|
||||
app:
|
||||
container_name: pihka-al-dev
|
||||
build:
|
||||
context: .
|
||||
target: build
|
||||
command: pnpm dev
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- DATABASE_URL=/data/db.sqlite
|
||||
- ADMIN_USERNAME=admin
|
||||
- ADMIN_PASSWORD=admin
|
||||
- REDIRECT_DOMAIN=localhost
|
||||
- NUXT_SESSION_PASSWORD=dev-session-password-32-chars-min
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
- db:/data
|
||||
|
||||
volumes:
|
||||
db:
|
||||
@@ -16,14 +16,11 @@ export default defineNuxtConfig({
|
||||
|
||||
css: ['~/assets/css/main.css'],
|
||||
|
||||
compatibilityDate: '2025-01-15',
|
||||
nitro: {
|
||||
externals: {
|
||||
external: ['better-sqlite3'],
|
||||
},
|
||||
},
|
||||
|
||||
eslint: {
|
||||
config: {
|
||||
stylistic: {
|
||||
commaDangle: 'never',
|
||||
braceStyle: '1tbs'
|
||||
}
|
||||
}
|
||||
}
|
||||
compatibilityDate: '2025-01-15',
|
||||
})
|
||||
|
||||
6
pnpm-workspace.yml
Normal file
6
pnpm-workspace.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
onlyBuiltDependencies:
|
||||
- "@parcel/watcher"
|
||||
- better-sqlite3
|
||||
- esbuild
|
||||
- unrs-resolver
|
||||
- vue-demi
|
||||
6
server/plugins/migrations.ts
Normal file
6
server/plugins/migrations.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { migrate } from 'drizzle-orm/better-sqlite3/migrator'
|
||||
import { db } from '../db'
|
||||
|
||||
export default defineNitroPlugin(() => {
|
||||
migrate(db, { migrationsFolder: 'server/db/migrations' })
|
||||
})
|
||||
Reference in New Issue
Block a user