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
|
FROM node:22-slim AS base
|
||||||
RUN corepack enable pnpm
|
RUN corepack enable
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache python3 make g++
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
@@ -16,7 +15,5 @@ RUN pnpm build
|
|||||||
FROM base AS runtime
|
FROM base AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/.output ./.output
|
COPY --from=build /app/.output ./.output
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
EXPOSE 3000
|
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 UBadge = resolveComponent("UBadge");
|
||||||
|
|
||||||
const props = defineProps<{
|
defineProps<{
|
||||||
data: Link[];
|
data: Link[];
|
||||||
status: "pending" | "idle" | "success" | "error";
|
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'],
|
css: ['~/assets/css/main.css'],
|
||||||
|
|
||||||
compatibilityDate: '2025-01-15',
|
nitro: {
|
||||||
|
externals: {
|
||||||
|
external: ['better-sqlite3'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
eslint: {
|
compatibilityDate: '2025-01-15',
|
||||||
config: {
|
|
||||||
stylistic: {
|
|
||||||
commaDangle: 'never',
|
|
||||||
braceStyle: '1tbs'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|||||||
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