diff --git a/Dockerfile b/Dockerfile index 4146add..bda9f08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,6 @@ WORKDIR /app # Set production environment ENV NODE_ENV="production" -# Set the database URL to a file before the build -ENV DATABASE_PATH="/data/sqlite.db" # Install pnpm ARG PNPM_VERSION=8.15.2 @@ -33,14 +31,12 @@ RUN pnpm install --frozen-lockfile --prod=false # Copy application code COPY --link . . -# Create temporary directory and db for the build to pass -RUN mkdir -p /data +# Add fake environment file for build to succeed +COPY --link .env.production.build .env.production.local RUN pnpm db:migrate # Build application -RUN --mount=type=secret,id=CHAINHOOKS_API_TOKEN \ - CHAINHOOKS_API_TOKEN="$(cat /run/secrets/CHAINHOOKS_API_TOKEN)" \ - pnpm run build +RUN pnpm run build # Remove development dependencies RUN pnpm prune --prod @@ -65,6 +61,7 @@ COPY --from=build /app/.next/static ./.next/static # Setup sqlite3 on a separate volume RUN mkdir -p /data VOLUME /data +ENV DATABASE_PATH="/data/sqlite.db" # Start the server by default, this can be overwritten at runtime EXPOSE 3000 diff --git a/package.json b/package.json index c69b2e2..281f2d0 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "class-variance-authority": "0.7.0", "clsx": "2.1.0", "drizzle-orm": "0.30.1", + "husky": "9.0.11", "javascript-time-ago": "2.5.9", "next": "14.1.3", "react": "18.2.0", @@ -43,7 +44,6 @@ "eslint": "8.57.0", "eslint-config-next": "14.1.3", "eslint-plugin-tailwindcss": "3.15.1", - "husky": "9.0.11", "lint-staged": "15.2.2", "postcss": "8.4.35", "radix-themes-tw": "0.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2fff6d1..17e9098 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ dependencies: drizzle-orm: specifier: 0.30.1 version: 0.30.1(@types/better-sqlite3@7.6.9)(@types/react@18.2.65)(better-sqlite3@9.4.3)(react@18.2.0) + husky: + specifier: 9.0.11 + version: 9.0.11 javascript-time-ago: specifier: 2.5.9 version: 2.5.9 @@ -88,9 +91,6 @@ devDependencies: eslint-plugin-tailwindcss: specifier: 3.15.1 version: 3.15.1(tailwindcss@3.4.1) - husky: - specifier: 9.0.11 - version: 9.0.11 lint-staged: specifier: 15.2.2 version: 15.2.2 @@ -4038,7 +4038,7 @@ packages: resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} engines: {node: '>=18'} hasBin: true - dev: true + dev: false /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}