accservermanager icon indicating copy to clipboard operation
accservermanager copied to clipboard

vtracker

Open dusnake opened this issue 3 years ago • 3 comments

Hi!

I would like to install this utility for your tool.

https://www.racedepartment.com/downloads/vtracker-2-timetable-for-acc-servers.40161/

I have seen you use these commands to start:

if which node > /dev/null then npm i node server.js else echo "Node is not installed. I try to install it myself :). This procedure will only be done once" sudo apt update sudo apt install npm npm install -g n sudo npm cache clean -f sudo npm install -g n sudo n stable PATH="$PATH" npm i node server.js fi

but it doesn't have npm installed, can you add it to docker to see how it works?

dusnake avatar Mar 17 '22 17:03 dusnake

Hi, this seems quite interesting. I'll have a look at it. However, I wonder if it would be an option to put vtracker into another container and just share the accservermanager-data volume? What do you think? (Edit: one could use https://hub.docker.com/_/node as base for that ...)

gotzl avatar Mar 18 '22 19:03 gotzl

I'll try it when I get some time, thank you very much!

dusnake avatar Mar 20 '22 17:03 dusnake

Hi, so, I came up with this Dockerfile

# might try to use slim or alpine, but the node pkgs require python
FROM node:current

ENV VTRACKER_APP_PATH="./VT 2.2.1/Linux" \
    NODE_ENV=production

WORKDIR /home/node/app/

COPY ${VTRACKER_APP_PATH} /home/node/app
RUN chown -R node:node /home/node/app && \
    chmod 755 /home/node/app/

USER node
RUN npm install

EXPOSE 9000
CMD ["npm", "start"]

and this docker-compose.yml

version: "2"
services:
  acc:
    image: gotzl/accservermanager
    volumes:
      - /tmp/server:/server
      - accservermanager-data:/data
    environment:
      - ALLOWED_HOSTS=["*"]
      - SECRET_KEY=
    ports:
      - 9232:9232/tcp
      - 9231:9231/udp
      - 8000:8000
  vtracker:
    build: .
    volumes:
      - accservermanager-data:/data:ro
    ports:
      - 9000:9000
volumes:
    accservermanager-data:

Put these in a directory and extract the vtracker package to the same dir. Adjust the docker-compose.yml to your likings, then run docker-compose build and docker-compose up. This should give you the vtracker on port 9000. In vtracker, add a server with directory /data/instances/somename/results/, where somename is the name you chose for your server in accservermanager.

Feel free to play around with that and tell me what you think.

gotzl avatar Mar 20 '22 23:03 gotzl