-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (21 loc) · 817 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM oven/bun:alpine AS build
WORKDIR /app
ENV VITE_BACKEND_URL=/api
COPY ["package.json", "bun.lockb", "./"]
COPY ["frontend/package.json", "frontend/bun.lockb", "./frontend/"]
COPY ["backend/package.json", "backend/bun.lockb", "./backend/"]
RUN cd frontend && bun install && cd ../backend && bun install
COPY . .
RUN cd frontend && bun run build
RUN cd backend && bun run build
FROM oven/bun:alpine AS app
WORKDIR /app
COPY ["backend/package.json", "backend/bun.lockb", "./"]
RUN bun install --production && rm -rf ~/.bun/install/cache
# Add db clients
RUN apk --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main add postgresql16-client
COPY --from=build /app/backend .
COPY --from=build /app/frontend/dist ./public/
COPY entrypoint.sh .
EXPOSE 3000
ENTRYPOINT ["sh", "entrypoint.sh"]