Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-alpine
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# System deps (git for cloning, fonts for rendering)
|
| 6 |
+
RUN apk add --no-cache git fontconfig ttf-dejavu ttf-freefont font-noto
|
| 7 |
+
|
| 8 |
+
# Fetch the app source
|
| 9 |
+
RUN git clone https://github.com/OlinadWiz/erdb.git .
|
| 10 |
+
|
| 11 |
+
# Install deps and build
|
| 12 |
+
RUN npm ci
|
| 13 |
+
RUN npm run build
|
| 14 |
+
|
| 15 |
+
# Ensure static assets are available when running the standalone server
|
| 16 |
+
RUN mkdir -p /app/.next/standalone/.next \
|
| 17 |
+
&& cp -r /app/.next/static /app/.next/standalone/.next/ \
|
| 18 |
+
&& if [ -d /app/public ]; then cp -r /app/public /app/.next/standalone/public; fi
|
| 19 |
+
|
| 20 |
+
# Runtime config
|
| 21 |
+
ENV NODE_ENV=production
|
| 22 |
+
ENV PORT=7860
|
| 23 |
+
|
| 24 |
+
# Persist cache/db (HF persistent storage can be mounted at /data if enabled)
|
| 25 |
+
RUN mkdir -p /app/data
|
| 26 |
+
VOLUME ["/app/data"]
|
| 27 |
+
|
| 28 |
+
EXPOSE 7860
|
| 29 |
+
CMD ["node", ".next/standalone/server.js"]
|