ayklee
ayklee
TtRPC
Created by ayklee on 4/8/2025 in #❓-help
TRPC giving 502 errors with jsonl header
This is my Dockerfile and docker-compose, by the way
# Base image with Bun
FROM oven/bun:latest AS base

WORKDIR /app

# Copy dependencies and install
COPY bun.lock package.json ./
COPY prisma ./prisma
RUN bun install

# Copy the rest of the app
COPY . .

ENV SKIP_ENV_VALIDATION=true

# Build the app
RUN bun run build

# -----
# Production image
FROM oven/bun:latest AS runner

WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000

# Copy built output and dependencies
COPY --from=base /app/.next ./.next
COPY --from=base /app/public ./public
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/package.json ./
COPY --from=base /app/prisma ./prisma

EXPOSE 3000

CMD ["bun", "deployment"]
# Base image with Bun
FROM oven/bun:latest AS base

WORKDIR /app

# Copy dependencies and install
COPY bun.lock package.json ./
COPY prisma ./prisma
RUN bun install

# Copy the rest of the app
COPY . .

ENV SKIP_ENV_VALIDATION=true

# Build the app
RUN bun run build

# -----
# Production image
FROM oven/bun:latest AS runner

WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000

# Copy built output and dependencies
COPY --from=base /app/.next ./.next
COPY --from=base /app/public ./public
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/package.json ./
COPY --from=base /app/prisma ./prisma

EXPOSE 3000

CMD ["bun", "deployment"]
services:
web:
build: .
ports:
- "3000:3000"
depends_on:
- db
env_file:
- .env
restart: unless-stopped

db:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- pgdata:/var/lib/postgresql/data

volumes:
pgdata:
services:
web:
build: .
ports:
- "3000:3000"
depends_on:
- db
env_file:
- .env
restart: unless-stopped

db:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- pgdata:/var/lib/postgresql/data

volumes:
pgdata:
4 replies