CognxSafeTrack commited on
Commit ·
8ff7abb
1
Parent(s): 4aef0ac
deploy: add root Dockerfile for Railway
Browse files- Dockerfile +23 -42
Dockerfile
CHANGED
|
@@ -1,51 +1,32 @@
|
|
| 1 |
-
FROM node:20
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
RUN
|
| 11 |
-
chromium \
|
| 12 |
-
openssl \
|
| 13 |
-
ca-certificates \
|
| 14 |
-
curl \
|
| 15 |
-
ffmpeg \
|
| 16 |
-
espeak-ng \
|
| 17 |
-
--no-install-recommends && \
|
| 18 |
-
rm -rf /var/lib/apt/lists/*
|
| 19 |
-
|
| 20 |
-
# Install pnpm and Typescript
|
| 21 |
-
RUN npm install -g pnpm@9 typescript tsx
|
| 22 |
-
|
| 23 |
-
# Copy ALL workspace files first for a proper pnpm install
|
| 24 |
-
COPY package.json pnpm-workspace.yaml ./
|
| 25 |
-
COPY packages/ packages/
|
| 26 |
-
COPY apps/ apps/
|
| 27 |
-
COPY scripts/ scripts/
|
| 28 |
-
|
| 29 |
-
# Install all dependencies
|
| 30 |
-
RUN pnpm install
|
| 31 |
-
|
| 32 |
-
# Generate Prisma Client
|
| 33 |
-
RUN pnpm --filter @repo/database generate
|
| 34 |
|
| 35 |
-
#
|
| 36 |
-
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
RUN pnpm -
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
#
|
| 46 |
-
ENV
|
|
|
|
| 47 |
|
| 48 |
-
#
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
| 1 |
+
FROM node:20
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# 1. Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y ffmpeg espeak-ng && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# 2. Copy project files
|
| 9 |
+
COPY . .
|
| 10 |
+
RUN npm install -g pnpm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# 3. Install all dependencies
|
| 13 |
+
RUN pnpm install --frozen-lockfile
|
| 14 |
|
| 15 |
+
# 4. Generate Prisma Client
|
| 16 |
+
RUN pnpm --filter @repo/database generate
|
| 17 |
|
| 18 |
+
# 5. Build all packages and apps
|
| 19 |
+
RUN pnpm --filter @repo/shared-types build
|
| 20 |
+
RUN pnpm --filter @repo/prompts build
|
| 21 |
+
RUN pnpm --filter api build
|
| 22 |
+
RUN pnpm --filter whatsapp-worker build
|
| 23 |
|
| 24 |
+
# 6. Environmental Setup
|
| 25 |
+
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
|
| 26 |
+
EXPOSE 8080
|
| 27 |
|
| 28 |
+
# 7. Make startup script executable
|
| 29 |
+
RUN chmod +x ./start.sh
|
| 30 |
|
| 31 |
+
# 8. Start everything via the master script
|
| 32 |
+
CMD ["./start.sh"]
|