Closed janheinrichmerker closed 2 years ago
Hi. I'm so sorry for the late response. Seems like my mail program hid the message and i hadn't a look into the repo in the last month.
Awesome that you tried it in docker! The error looks like a build error of a unfinished version on the dev branch. I was able finish the work for the keymaps and the custom controls this week, so it should work now out of the box.
Can you try it again with the latest master version? Thanks! :)
I had to hack some additional changes even after pulling the latest master version. But now this Dockerfile builds and runs:
FROM alpine/git:v2.26.2 AS clone
RUN git config --global advice.detachedHead false
RUN git clone https://github.com/Tschuck/battletris.git /app
WORKDIR /app
RUN git checkout 35b273d5bae895084ca0aea9708fcd90a1a510a0
RUN rm -rf .git
FROM node:16.13.0-alpine AS build
COPY --from=clone /app /app
WORKDIR /app
RUN yarn install
# Fix deprecated types.
RUN sed -i "s/Record<string, string>/Record<string, string | string[]>/g" backend/src/server/RoomHandler.ts
# Refresh browser data.
RUN cd frontend && npx browserslist@latest --update-db
# Update frontend build target.
RUN sed -i "s/\"target\": \"esnext\"/\"target\": \"es2019\"/g" frontend/tsconfig.json
# Update server.
ARG BATTLETRIS_SERVER="localhost:5000"
RUN sed -i "s/https:\/\/battletris.de/http:\/\/$BATTLETRIS_SERVER/g; s/wss:\/\/battletris.de/ws:\/\/$BATTLETRIS_SERVER/g" frontend/.env.production
RUN yarn deploy
FROM node:16.13.0-alpine
COPY --from=build /app/.deploy /app
WORKDIR /app
RUN yarn install
EXPOSE 5000
CMD ["yarn", "start"]
Nice! Looks good thanks. Probably i need to fix some small things, so the replacing would not be necessary.
That would be great!
Maybe read the server hostname from an environment variable, so that we can have localhost:5000
as default and override this for production easily?
Then, after some compatibility updates I can create a pull request with a simple, minimal Dockerfile.
Alright. Will test the stuff the next days!
Btw. i found your "spieleabend" repo. Nice idea
Thanks! And feel free to reuse it! (Or suggest additional games.)
Closing due to inactivity.
I've had some issues running this nice app in Docker. It seems like at some time, dependencies are not found. My Dockerfile executes the commands mentioned in the readme. Attached you'll find my Dockerfile:
This is the output log: