(Probably) fixes the build
This probably fixes the build that I broke in https://github.com/OpenPipe/OpenPipe/pull/149. However, there's a small chance that it fixes it enough to deploy, but not enough to actually work. That would be bad, so not merging until I have time to monitor the deploy.
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
**/node_modules/
|
||||
.git
|
||||
**/.venv/
|
||||
**/.env*
|
||||
**/.next/
|
||||
@@ -6,13 +6,13 @@ RUN yarn global add pnpm
|
||||
# DEPS
|
||||
FROM base as deps
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /code
|
||||
|
||||
COPY prisma ./
|
||||
COPY app/prisma app/package.json ./app/
|
||||
COPY client-libs/typescript/package.json ./client-libs/typescript/
|
||||
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN cd app && pnpm install --frozen-lockfile
|
||||
|
||||
# BUILDER
|
||||
FROM base as builder
|
||||
@@ -25,22 +25,24 @@ ARG NEXT_PUBLIC_SENTRY_DSN
|
||||
ARG SENTRY_AUTH_TOKEN
|
||||
ARG NEXT_PUBLIC_FF_SHOW_LOGGED_CALLS
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
WORKDIR /code
|
||||
COPY --from=deps /code/node_modules ./node_modules
|
||||
COPY --from=deps /code/app/node_modules ./app/node_modules
|
||||
COPY --from=deps /code/client-libs/typescript/node_modules ./client-libs/typescript/node_modules
|
||||
COPY . .
|
||||
RUN SKIP_ENV_VALIDATION=1 pnpm build
|
||||
RUN cd app && SKIP_ENV_VALIDATION=1 pnpm build
|
||||
|
||||
# RUNNER
|
||||
FROM base as runner
|
||||
WORKDIR /app
|
||||
WORKDIR /code/app
|
||||
|
||||
ENV NODE_ENV production
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
COPY --from=builder /app/ ./
|
||||
COPY --from=builder /code/ /code/
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT 3000
|
||||
|
||||
# Run the "run-prod.sh" script
|
||||
CMD /app/run-prod.sh
|
||||
CMD /code/app/run-prod.sh
|
||||
9
app/test-docker.sh
Executable file
9
app/test-docker.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
source app/.env
|
||||
|
||||
docker build . --file app/Dockerfile
|
||||
@@ -7,9 +7,8 @@ databases:
|
||||
services:
|
||||
- type: web
|
||||
name: querykey-prod-web
|
||||
rootDir: app
|
||||
env: docker
|
||||
dockerfilePath: Dockerfile
|
||||
dockerfilePath: ./app/Dockerfile
|
||||
dockerContext: .
|
||||
plan: standard
|
||||
domains:
|
||||
@@ -32,9 +31,8 @@ services:
|
||||
|
||||
- type: web
|
||||
name: querykey-prod-wss
|
||||
rootDir: app
|
||||
env: docker
|
||||
dockerfilePath: Dockerfile
|
||||
dockerfilePath: ./app/Dockerfile
|
||||
dockerContext: .
|
||||
plan: free
|
||||
dockerCommand: pnpm tsx src/wss-server.ts
|
||||
|
||||
Reference in New Issue
Block a user