# Nakama Server Runtime Typescript

**URL:** <https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091>\
**Category:** Runtime Framework\
**Created:** [July 19, 2023, 2:07am UTC](https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091 "2023-07-19T02:07:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/justin/32/1702_2.png) [@justin](https://forum.heroiclabs.com/u/justin)\
**Post date:** [July 19, 2023, 2:07am UTC](https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091/1 "2023-07-19T02:07:55Z")

</div>

having similar issue with this [Nakama/Docker Path Issues](https://forum.heroiclabs.com/t/nakama-docker-path-issues/2749), although im not quite sure whats the directory looks like, mine is like this:

basically im getting this error when running `docker compose up`:

`{"level":"fatal","ts":"2023-07-19T01:55:05.678Z","caller":"server/config.go:306","msg":"JavaScript entrypoint must be a valid path","error":"stat data/modules/build/index.js: no such file or directory"}`

```auto
.
├── build/
├── data/
│ ├── modules/
│ └── .cookie [RO]
│ └── logfile.log
│ └── my-config.yml
├── node_modules/
│ ├── nakama-runtime/
│ └── typescript/
├── docker-compose.yml
├── Dockerfile
├── package-lock.json
├── package.json
├── src/
└── tsconfig.json

```

`my-config.yml`

```auto
name: nakama-node-1
data_dir: "./data"

logger:
    stdout: true
    level: "warn"
    file: "/nakama/data/logfile.log"

runtime:
  js_entrypoint: "build/index.js"

console:
    port: 7351
    username: "root"
    password: "password"

```

`Dockerfile`

```auto
FROM node:alpine AS node-builder

WORKDIR /backend

COPY package*.json ./
RUN npm install

COPY tsconfig.json ./
COPY src/*.ts ./
RUN npx tsc

FROM heroiclabs/nakama:3.16.0

COPY --from=node-builder /backend/build/*.js /nakama/data/modules/build/
COPY my-config.yml /nakama/data/

```

`docker-compose.yml`

```auto
version: '3'
services:
  postgres:
    command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
    container_name: postgres
    image: postgres:12.2-alpine
    environment:
      - POSTGRES_DB=nakama
      - POSTGRES_PASSWORD=localdb
    volumes:
      - data:/var/lib/postgresql/data
    expose:
      - "8080"
      - "5432"
    ports:
      - "5432:5432"
      - "8080:8080"
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres", "-d", "nakama"]
      interval: 3s
      timeout: 3s
      retries: 5

  nakama:
    build: .
    container_name: nakama
    image: registry.heroiclabs.com/heroiclabs/nakama:3.16.0
    entrypoint:
      - "/bin/sh"
      - "-ecx"
      - >
          /nakama/nakama migrate up --database.address postgres:localdb@postgres:5432/nakama &&
          exec /nakama/nakama --name nakama1 --config /nakama/data/my-config.yml --database.address postgres:localdb@postgres:5432/nakama --logger.level DEBUG --session.token_expiry_sec 7200
    links:
      - "postgres:db"
    depends_on:
      postgres:
        condition: service_healthy
    volumes:
      - ./data:/nakama/data
    expose:
      - "7349"
      - "7350"
      - "7351"
    ports:
      - "7349:7349"
      - "7350:7350"
      - "7351:7351"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7350/"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
volumes:
  data:

```

---

<div class="post-metadata">

**Author:** ![yurisq](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/yurisq/32/1725_2.png) [@yurisq](https://forum.heroiclabs.com/u/yurisq)\
**Post date:** [July 19, 2023, 7:31am UTC](https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091/2 "2023-07-19T07:31:20Z")

</div>

Long story short, the problem is that you mount the data folder from your PC with the docker one, which overwrites everything.

In order to make it work, you’ll have to delete these lines from docker-compose.yml :

> [@justin](#):
>
> ```auto
> volumes:
> - ./data:/nakama/data
> 
> ```

But to fix the docker compose up --build command, you’ll have to change this line in Dockerfile as well :

> [@justin](#):
>
> `COPY src/*.ts ./`

to:

```auto
COPY src ./src

```

As I can see, @khamarr3524 in [Nakama/Docker Path Issues](https://forum.heroiclabs.com/t/nakama-docker-path-issues/2749) have the same problem.

---

<div class="post-metadata">

**Author:** ![justin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/justin/32/1702_2.png) [@justin](https://forum.heroiclabs.com/u/justin)\
**Post date:** [July 19, 2023, 11:26pm UTC](https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091/3 "2023-07-19T23:26:02Z")

</div>

sweet that did it, thanks a lot @yurisq . one thing I changed is the Dockerfile with line: `COPY my-config.yml /nakama/data/` to `COPY /data/my-config.yml`

side note, if somebody is also having this issue and still couldnt get it working, stop docker service, delete your `.docker` directory and restart it, after that run `docker compose up --build`

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [July 20, 2023, 12:51pm UTC](https://forum.heroiclabs.com/t/nakama-server-runtime-typescript/4091/4 "2023-07-20T12:51:16Z")

</div>

`docker compose up --build` should suffice I think, unless there was some other issue.

If you really want to delete all associated containers and volumes you can run:  
`docker compose down -v` ( **this will delete all the database container data** )
