-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (34 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
50 lines (34 loc) · 1.32 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
# syntax=docker/dockerfile:1
FROM node:23-alpine
LABEL org.opencontainers.image.source="https://github.com/Dcup-dev/dcup"
LABEL org.opencontainers.image.description="Dcup RAG-as-a-Service platform"
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.title="Dcup RAG-as-a-Service"
LABEL org.opencontainers.image.version="v1.1.3-beta"
LABEL org.opencontainers.image.authors="Ali Amer <aliamer19ali@gmail.com>"
# Install required OS packages including Python
RUN apk add --no-cache libc6-compat python3 py3-pip
WORKDIR /app
COPY package.json package-lock.json* ./
# Install Node dependencies (this runs your postinstall that creates the Python venv)
RUN npm ci
COPY . .
# Add the entrypoint script to the container
COPY docker-entrypoint.sh /usr/local/bin/
# Make sure the entrypoint script is executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN set -a && \
[ -f .env ] && . .env; \
npm run build
COPY .env .next/standalone/.env
RUN cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/
# Set production environment variables
ENV NODE_ENV=production
ENV PORT=8080
ENV HOSTNAME=0.0.0.0
# Create non-root user for running the app
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
EXPOSE 8080
USER nextjs
ENTRYPOINT ["docker-entrypoint.sh"]