-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any reason to not provide a docker image or a Dockerfile? #228
Comments
你只需要在根目录下创建以下文件: .dockerignore
Dockerfile FROM node:18-bullseye-slim AS build
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install --quiet
FROM node:18
COPY --from=build /usr/src/app /usr/src/app
RUN npm install pm2 -g --quiet
WORKDIR /usr/src/app
## dependencies hackchat-server
## https://github.com/npm/npm/issues/13306
## Replace renameSync with FS's moveSync to resolve the following error message
## Error: EXDEV: cross-device link not permitted, rename '/usr/src/app/commands/' -> '/usr/src/app/commands.z9kcbo'
RUN npm install fs-extra && sed -i -e "s/renameSync/moveSync/g" /usr/src/app/node_modules/hackchat-server/src/serverLib/ImportsManager.js
EXPOSE 6060 3000
CMD ["pm2-runtime", "start", "pm2.config.cjs", "--node-args='-r esm'", "--name", "hackchat"] 接着使用 docker compose 的方式运行它。 docker-compose.yml version: "3.7"
services:
hack-chat:
container_name: hack-chat
build:
context: .
dockerfile: Dockerfile
restart: on-failure 值得一提的是,在运行 docker compose 之前你需要先使用 npm run config 来生成 session.key、salt.key 文件。 正常运行后,你需要将 6060 端口用于 ws wss,3000 端口用于 web,这一步你可以看 jheretic/docker-hack-chat,里面介绍的非常详细。 |
5 years ago I used this: https://hub.docker.com/r/mcgriddle/hack-chat
But is not working anymore. Any tips? For sure I can write a dockerfile for me, but I'd like to see if there is any reason to not provide a official one.
The text was updated successfully, but these errors were encountered: