forked from vas3k/TaxHacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (48 loc) · 1.31 KB
/
Dockerfile
File metadata and controls
65 lines (48 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM node:23-slim AS base
# Default environment variables
ENV PORT=7331
ENV NODE_ENV=production
# Build stage
FROM base AS builder
# Install dependencies required for Prisma
RUN apt-get update && apt-get install -y openssl
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY prisma ./prisma/
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM base
# Install required system dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
ghostscript \
graphicsmagick \
openssl \
libwebp-dev \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Create upload directory and set permissions
RUN mkdir -p /app/upload
# Copy built assets from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/app ./app
COPY --from=builder /app/next.config.ts ./
# Copy and set up entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Create directory for uploads
RUN mkdir -p /app/data
EXPOSE 7331
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["npm", "start"]