Skip to content

Commit

Permalink
fix: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed Mar 17, 2024
1 parent ee9fa4f commit 76dcf90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76dcf90

Please sign in to comment.