-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.simple
More file actions
49 lines (37 loc) · 1.34 KB
/
Dockerfile.simple
File metadata and controls
49 lines (37 loc) · 1.34 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
FROM node:20-alpine
WORKDIR /app
# Install dependencies (including cron and sqlite for audit log cleanup)
RUN apk add --no-cache wget dcron sqlite
# Copy package files
COPY package*.json ./
# Install ALL dependencies (including devDependencies for build)
RUN npm install
# Copy all source files
COPY . .
# Build application
RUN npm run build
# Copy scripts before building
COPY scripts/cleanup-audit-logs.sh scripts/cleanup-audit-logs.sh
COPY scripts/entrypoint.sh scripts/entrypoint.sh
RUN chmod +x scripts/*.sh
# Copy static files to standalone directory
RUN cp -r .next/static .next/standalone/.next/static && \
mkdir -p .next/standalone/public && \
cp -r public/. .next/standalone/public/ && \
ls -la .next/standalone/public/ && \
mkdir -p .next/standalone/scripts && \
cp scripts/*.sh .next/standalone/scripts/ && \
mkdir -p .next/standalone/lib/db && \
cp lib/db/schema.sql .next/standalone/lib/db/schema.sql
# Create data directory in standalone and root (for Railway)
RUN mkdir -p /app/.next/standalone/data && \
mkdir -p /app/data && \
chmod -R 777 /app/data /app/.next/standalone/data
EXPOSE 3000
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
ENV AUDIT_RETENTION_DAYS=30
# Use entrypoint script to set up cron and start app
WORKDIR /app/.next/standalone
CMD ["/app/.next/standalone/scripts/entrypoint.sh"]