Skip to content

Commit

Permalink
feat: dockerfile and dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
pineylilly committed Nov 2, 2024
1 parent dea4186 commit 39b916a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Dockerfile
node_modules
npm-debug.log
dist
# .env
.env
.env.example
.gitignore
*.md
Expand Down
18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oven/bun AS build
FROM oven/bun:1-alpine AS build

WORKDIR /app

Expand All @@ -23,13 +23,27 @@ RUN bun build \
--outfile server \
./src/index.ts

FROM debian:bullseye AS prod
FROM node:23-bullseye AS prod

WORKDIR /app

COPY --from=build /app/server /app/server
COPY --from=build /app/node_modules/.prisma/client /app/node_modules/.prisma/client
COPY --from=build /app/prisma/schema.prisma /app/prisma/schema.prisma

RUN npm install prisma --save-dev

CMD ["/app/server"]

EXPOSE 3000

# FROM debian:bullseye AS prod

# WORKDIR /app

# COPY --from=build /app/server /app/server
# COPY --from=build /app/node_modules/.prisma/client /app/node_modules/.prisma/client

# CMD ["/app/server"]

# EXPOSE 3000

0 comments on commit 39b916a

Please sign in to comment.