Make front's dev dockerfile

This commit is contained in:
Zoe Roux 2025-06-21 13:57:38 +02:00
parent 69c4e4e6d8
commit 713f3ca96f
No known key found for this signature in database
4 changed files with 45 additions and 77 deletions

View File

@ -25,26 +25,25 @@ x-transcoder: &transcoder-base
target: /app target: /app
services: services:
# front: front:
# build: build:
# context: ./front context: ./front
# dockerfile: Dockerfile.dev dockerfile: Dockerfile.dev
# volumes: restart: unless-stopped
# - ./front:/app ports:
# - /app/.yarn - "8081:8081"
# - /app/node_modules environment:
# - /app/apps/mobile/node_modules - KYOO_URL=${KYOO_URL:-http://api:5000/api}
# - /app/apps/web/.next/ labels:
# - /app/apps/mobile/.expo/ - "traefik.enable=true"
# ports: - "traefik.http.routers.front.rule=PathPrefix(`/`)"
# - "3000:3000" develop:
# - "8081:8081" watch:
# restart: unless-stopped - action: sync
# environment: path: ./front
# - KYOO_URL=${KYOO_URL:-http://api:5000/api} target: /app
# labels: - action: rebuild
# - "traefik.enable=true" path: ./front/bun.lock
# - "traefik.http.routers.front.rule=PathPrefix(`/`)"
auth: auth:
build: build:
@ -82,6 +81,8 @@ services:
- JWT_ISSUER=${PUBLIC_URL} - JWT_ISSUER=${PUBLIC_URL}
env_file: env_file:
- ./.env - ./.env
volumes:
- images:/app/images
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.api.rule=PathPrefix(`/api/`) || PathPrefix(`/swagger`)" - "traefik.http.routers.api.rule=PathPrefix(`/api/`) || PathPrefix(`/swagger`)"
@ -95,7 +96,7 @@ services:
path: ./api path: ./api
target: /app target: /app
- action: rebuild - action: rebuild
path: ./api/packages.json path: ./api/bun.lock
scanner: scanner:
build: ./scanner build: ./scanner
@ -206,4 +207,5 @@ services:
volumes: volumes:
db: db:
images:
transcoder_metadata: transcoder_metadata:

View File

@ -1,14 +1,9 @@
Dockerfile **
Dockerfile.dev !/package.json
.dockerignore !/bun.lock
.eslintrc.json !/tsconfig.json
.gitignore !/metro.config.js
node_modules !/app.config.ts
npm-debug.log !/src
README.md !/app
.next !/public
.expo
.git
.yarn
!.yarn/releases
!.yarn/plugins

View File

@ -1,32 +1,10 @@
FROM node:18-alpine AS builder FROM oven/bun AS builder
WORKDIR /app WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./ COPY package.json bun.lock .
COPY package.json yarn.lock ./ RUN bun install --production
COPY apps/web/package.json apps/web/package.json
COPY apps/mobile/package.json apps/mobile/package.json
COPY packages/ui/package.json packages/ui/package.json
COPY packages/primitives/package.json packages/primitives/package.json
COPY packages/models/package.json packages/models/package.json
RUN yarn --immutable
COPY . . COPY . .
ENV NEXT_TELEMETRY_DISABLED=1 RUN bun build
ENV NODE_ENV=production
RUN yarn build:web
# TODO: Actually do something there, either nginx or preferably an ssr bun serv
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/apps/web/.next/standalone/apps/web .
COPY --from=builder /app/apps/web/.next/standalone/node_modules ./node_modules
COPY --from=builder /app/apps/web/.next/static ./.next/static/
COPY --from=builder /app/apps/web/public ./public
EXPOSE 8901
ENV PORT=8901
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
CMD ["node", "server.js"]

View File

@ -1,17 +1,10 @@
FROM node:18-alpine FROM oven/bun
RUN apk add git bash
WORKDIR /app WORKDIR /app
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY package.json yarn.lock ./
COPY apps/web/package.json apps/web/package.json
COPY apps/mobile/package.json apps/mobile/package.json
COPY packages/ui/package.json packages/ui/package.json
COPY packages/primitives/package.json packages/primitives/package.json
COPY packages/models/package.json packages/models/package.json
RUN yarn --immutable
ENV NEXT_TELEMETRY_DISABLED=1 COPY package.json bun.lock .
EXPOSE 3000 RUN bun install --frozen-lockfile
COPY . .
EXPOSE 8081 EXPOSE 8081
ENTRYPOINT ["yarn", "dev"] CMD ["bun", "dev"]