Skip to content

Commit

Permalink
dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyzzp committed Jun 11, 2024
1 parent 750cbe2 commit e52926f
Show file tree
Hide file tree
Showing 9 changed files with 2,948 additions and 1,843 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
/server/node_modules
/server/dist

/imgs

/dist
/build.bat
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM node:alpine as build_server
WORKDIR /app
COPY . .
RUN npm i -g pnpm
RUN cd client && pnpm i && pnpm run build
RUN cd server && pnpm i && pnpm run build
RUN cd client && npm i && npm run build
RUN cd server && npm i && npm run build


FROM node:alpine
EXPOSE 80
WORKDIR /app
COPY --from=build_server /app/client/dist .
COPY --from=build_server /app/server/dist .
CMD [ "node", "main.mjs" ]
ENTRYPOINT ["node", "webrtc.server.mjs"]
8 changes: 4 additions & 4 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@echo off
echo ----- build server
call pnpm -C server i
call pnpm -C server run build
call npm -C server i
call npm -C server run build

echo ----- build client
call pnpm -C client i
call pnpm -C client run build
call npm -C client i
call npm -C client run build

echo ----- copy files to /dist
rd /s /q dist
Expand Down
Loading

0 comments on commit e52926f

Please sign in to comment.