N-FIN-78: replace npm with bun
This commit is contained in:
parent
1aa3ed85c5
commit
021bfcc65d
5 changed files with 12 additions and 7824 deletions
14
Dockerfile
14
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
FROM node:21-alpine AS base
|
FROM oven/bun AS base
|
||||||
|
|
||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
|
@ -6,8 +6,8 @@ FROM base AS deps
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN apk add --no-cache libc6-compat
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json bun.lockb* ./
|
||||||
RUN npm ci
|
RUN bun install
|
||||||
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
|
@ -18,15 +18,15 @@ COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# dependencies have to be changed depending on target architecture
|
# dependencies have to be changed depending on target architecture
|
||||||
RUN npm i @node-rs/argon2-linux-x64-musl # arm64 = @node-rs/argon2-linux-arm64-musl
|
RUN bun install @node-rs/argon2-linux-x64-musl # arm64 = @node-rs/argon2-linux-arm64-musl
|
||||||
RUN npm i @node-rs/bcrypt-linux-x64-musl # arm64 = @node-rs/bcrypt-linux-arm64-musl
|
RUN bun install @node-rs/bcrypt-linux-x64-musl # arm64 = @node-rs/bcrypt-linux-arm64-musl
|
||||||
|
|
||||||
COPY prisma/ ./prisma/
|
COPY prisma/ ./prisma/
|
||||||
|
|
||||||
RUN npx prisma generate
|
RUN bunx prisma generate
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
RUN npm run build
|
RUN bun run build
|
||||||
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
|
|
|
@ -42,13 +42,13 @@ cp .env.example .env
|
||||||
docker compose -f docker/finances-dev/docker-compose.yml up -d
|
docker compose -f docker/finances-dev/docker-compose.yml up -d
|
||||||
|
|
||||||
## generate prisma client
|
## generate prisma client
|
||||||
npx prisma generate
|
bunx prisma generate
|
||||||
|
|
||||||
## apply database migrations
|
## apply database migrations
|
||||||
npx prisma migrate deploy
|
bunx prisma migrate deploy
|
||||||
|
|
||||||
## start the development server
|
## start the development server
|
||||||
npm run dev
|
bun run dev
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
BIN
bun.lockb
Executable file
BIN
bun.lockb
Executable file
Binary file not shown.
|
@ -8,7 +8,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
command: npx prisma migrate deploy
|
command: bunx prisma migrate deploy
|
||||||
labels:
|
labels:
|
||||||
- "com.centurylinklabs.watchtower.enable=true"
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
networks:
|
networks:
|
||||||
|
@ -42,7 +42,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
app-migrations:
|
app-migrations:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
command: npx prisma studio
|
command: bunx prisma studio
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
|
|
7812
package-lock.json
generated
7812
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue