Add root Dockerfile for Dokploy deployment
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
FROM oven/bun:1 as builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the entire repo
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install dependencies for API
|
||||||
|
WORKDIR /app/apps/api
|
||||||
|
RUN bun install --frozen-lockfile
|
||||||
|
|
||||||
|
# Production image
|
||||||
|
FROM oven/bun:1-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy from builder
|
||||||
|
COPY --from=builder /app/apps/api/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/apps/api/package.json ./
|
||||||
|
COPY --from=builder /app/apps/api/src ./src
|
||||||
|
COPY --from=builder /app/apps/api/drizzle.config.ts ./
|
||||||
|
|
||||||
|
# Set environment
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV PORT=3001
|
||||||
|
|
||||||
|
EXPOSE 3001
|
||||||
|
|
||||||
|
CMD ["sh", "-c", "bun run db:push && bun run start"]
|
||||||
Reference in New Issue
Block a user