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

View File

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

View File

@ -1,32 +1,10 @@
FROM node:18-alpine AS builder
FROM oven/bun AS builder
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
COPY package.json bun.lock .
RUN bun install --production
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
RUN yarn build:web
RUN bun build
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"]
# TODO: Actually do something there, either nginx or preferably an ssr bun serv

View File

@ -1,17 +1,10 @@
FROM node:18-alpine
RUN apk add git bash
FROM oven/bun
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
EXPOSE 3000
COPY package.json bun.lock .
RUN bun install --frozen-lockfile
COPY . .
EXPOSE 8081
ENTRYPOINT ["yarn", "dev"]
CMD ["bun", "dev"]