mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
- Modify the Dockerfile in the `server/quests/helloworld` directory to add a user and change the working directory - Rename the file `server/quests/helloworld/entrypoint.sh` to `server/quests/helloworld/home/.bashrc` - Modify the `server/src/config.js` file to add the `isProduction` flag - Modify the `server/src/utils/docker.js` file to add a `HostConfig` option and bind a directory if not in production mode - Modify the Dockerfile to add an argument `DOCKER_GID` and create a group and user with the specified `DOCKER_GID` - Add a new Dockerfile.dev file with the same modifications as the Dockerfile - Add a new file `inspect.sh` - Modify the `server/src/client.js` file to use the `API_ENDPOINT` variable instead of a hardcoded URL Signed-off-by: wancat <wancat@wancat.cc>
25 lines
423 B
Docker
25 lines
423 B
Docker
FROM node
|
|
|
|
WORKDIR /app
|
|
COPY package.json yarn.lock ./
|
|
COPY server/package.json ./server/
|
|
RUN yarn install --frozen-lockfile --production
|
|
|
|
ARG DOCKER_GID=140
|
|
|
|
RUN groupadd -g $DOCKER_GID docker && usermod -aG docker node
|
|
|
|
WORKDIR /app/server
|
|
|
|
USER node
|
|
|
|
COPY server/src ./src
|
|
COPY server/quests ./quests
|
|
COPY server/swagger.yaml .
|
|
|
|
ENV NODE_ENV=production
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3000
|
|
EXPOSE 3000
|
|
|
|
CMD [ "yarn", "start" ] |