forked from PrismarineJS/prismarine-web-client
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make main docker build 5x smaller, add only proxy dockerfile
- Loading branch information
Showing
3 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
FROM node:18-alpine | ||
# ---- Build Stage ---- | ||
FROM node:18-alpine AS build | ||
# Without git installing the npm packages fails | ||
RUN apk add git | ||
RUN mkdir /app | ||
RUN apk add --no-cache git python3 make g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev | ||
WORKDIR /app | ||
COPY . /app | ||
# install python and other dependencies | ||
RUN apk add python3 make g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev | ||
# install pnpm | ||
RUN npm i -g [email protected] | ||
RUN pnpm install | ||
# only for prod | ||
RUN pnpm run build | ||
# --- | ||
EXPOSE 8080 | ||
# uncomment for development | ||
|
||
# TODO for development | ||
# EXPOSE 9090 | ||
# VOLUME /app/src | ||
# VOLUME /app/prismarine-viewer | ||
# ENTRYPOINT ["pnpm", "run", "run-all"] | ||
|
||
# only for prod | ||
ENTRYPOINT ["npm", "run", "prod-start"] | ||
RUN pnpm run build | ||
|
||
# ---- Run Stage ---- | ||
FROM node:18-alpine | ||
RUN apk add git | ||
WORKDIR /app | ||
# Copy build artifacts from the build stage | ||
COPY --from=build /app/dist /app/dist | ||
COPY server.js /app/server.js | ||
# Install express | ||
RUN npm i -g [email protected] | ||
RUN npm init -yp | ||
RUN pnpm i express github:zardoy/prismarinejs-net-browserify compression cors | ||
EXPOSE 8080 | ||
ENTRYPOINT ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ---- Run Stage ---- | ||
FROM node:18-alpine | ||
RUN apk add git | ||
WORKDIR /app | ||
COPY server.js /app/server.js | ||
# Install server dependencies | ||
RUN npm i -g [email protected] | ||
RUN npm init -yp | ||
RUN pnpm i express github:zardoy/prismarinejs-net-browserify compression cors | ||
EXPOSE 8080 | ||
ENTRYPOINT ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters