diff --git a/examples/avalon/Dockerfile b/examples/avalon/Dockerfile index dcd26824..046121e5 100644 --- a/examples/avalon/Dockerfile +++ b/examples/avalon/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/boggle/Dockerfile b/examples/boggle/Dockerfile index dcd26824..046121e5 100644 --- a/examples/boggle/Dockerfile +++ b/examples/boggle/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/chat/Dockerfile b/examples/chat/Dockerfile index dcd26824..046121e5 100644 --- a/examples/chat/Dockerfile +++ b/examples/chat/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/chess/Dockerfile b/examples/chess/Dockerfile index dcd26824..046121e5 100644 --- a/examples/chess/Dockerfile +++ b/examples/chess/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/codenames/Dockerfile b/examples/codenames/Dockerfile index dcd26824..046121e5 100644 --- a/examples/codenames/Dockerfile +++ b/examples/codenames/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/poker/Dockerfile b/examples/poker/Dockerfile index dcd26824..046121e5 100644 --- a/examples/poker/Dockerfile +++ b/examples/poker/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/pong/Dockerfile b/examples/pong/Dockerfile index dcd26824..046121e5 100644 --- a/examples/pong/Dockerfile +++ b/examples/pong/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/rock-paper-scissor/Dockerfile b/examples/rock-paper-scissor/Dockerfile index dcd26824..046121e5 100644 --- a/examples/rock-paper-scissor/Dockerfile +++ b/examples/rock-paper-scissor/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/examples/uno/Dockerfile b/examples/uno/Dockerfile index dcd26824..046121e5 100644 --- a/examples/uno/Dockerfile +++ b/examples/uno/Dockerfile @@ -1,18 +1,24 @@ -FROM node:18.18-alpine - -RUN apk add --update git - -# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 -RUN apk add --no-cache libc6-compat -RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@0.12.1 RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data diff --git a/templates/base/Dockerfile.hbs b/templates/base/Dockerfile.hbs index 8060b4b1..a7c101cf 100644 --- a/templates/base/Dockerfile.hbs +++ b/templates/base/Dockerfile.hbs @@ -1,12 +1,24 @@ -FROM node:18 +FROM node:18.18-alpine as build WORKDIR /app +RUN apk add --update git + COPY . . RUN npm i -g hathora@{{ hathoraVersion }} RUN npx hathora build --only server +FROM node:18.18-alpine + +WORKDIR /app + +# https://github.com/uNetworking/uWebSockets.js/discussions/346#discussioncomment-1137301 +RUN apk add --no-cache libc6-compat +RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 + +COPY --from=build /app/server/dist server/dist + ENV NODE_ENV=production ENV DATA_DIR=/app/data