---
title: "Comment by Manuel on \"🐳 Docker with Strapi V4 🌟\" | Hashnode"
description: "Hi first off all thank you for this tutorial. I guess i&#39;m missing one last step. I did everything exactly as described in the tutorial except that i don&#39"
url: "https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860"
---

[Discussion](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd)

Comment [🐳 Docker with Strapi V4 🌟](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd)

[Manuel](https://hashnode.com/@Manuel187)

[Feb 9, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860)

Hi first off all thank you for this tutorial.

I guess i'm missing one last step. I did everything exactly as described in the tutorial except that i don't have an `build .` in the docker compose but i push an image into my own container registry before it and then use that image.

So this is my docker-compose file:

```
version: '3'
services:
    strapi:
      container_name: strapi
      image: ghcr.io/confidato/strapi-cms:latest
      restart: unless-stopped
      env_file: .env
      environment:
        DATABASE_CLIENT: ${DATABASE_CLIENT}
        DATABASE_HOST: postgresDB
        DATABASE_NAME: ${DATABASE_NAME}
        DATABASE_USERNAME: ${DATABASE_USERNAME}
        DATABASE_PORT: ${DATABASE_PORT}
        JWT_SECRET: ${JWT_SECRET}
        DATABASE_PASSWORD: ${DATABASE_PASSWORD}
        NODE_ENV: ${NODE_ENV}
      links:
        - postgresDB:postgresDB
      volumes:
        - ./public:/public/upload
        #- ./src:/opt/app/src ### If this line is not in the file it starts.
      ports:
        - "1337:1337"
      depends_on:
        - postgresDB

    postgresDB:
      image: postgres:12.0-alpine
      container_name: postgresDB
      restart: unless-stopped
      env_file: .env
      environment:
        POSTGRES_USER: ${DATABASE_USERNAME}
        POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
        POSTGRES_DB: ${DATABASE_NAME}
      volumes:
        - ./data:/var/lib/postgresql/data/
      ports:
        - "5432:5432"

networks:
  default:
    external:
      name: network123
```

If i start it without the line `- ./src:/opt/app/src` in volumes everthing looks good but if i use `docker-compose down` my data won't show up again in the admin-dashboard. I guess i have a problem with my volume mapping. If I add the line `- ./src:/opt/app/src` strapi has an error at startup and it says: `Missing api folder. Please create one at './src/api'`.

Any idea where my problem is?

[Simen Daehlin](https://hashnode.com/@eventyret)

[Feb 9, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860#reply-6203e10d9e350308247fb88b)

I do think that if you are mapping the whole src folder you will also map node\_modules. Did have some issues with that before even when making node\_modules outside the parent folder.

[Manuel](https://hashnode.com/@Manuel187)

[Feb 10, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860#reply-6204f1e09e350308247fcf7d)

[Simen Daehlin](https://hashnode.com/@eventyret) My dockerfile looks exactly like yours. But mounting `/opt/app/src` should not affect the node\_modules. When I start strapi without the mounted volume I have the folders `admin`, `api` and `extensions` and the `index.js` file under the folder `/opt/app/src`. So exactly as I would expect. When I insert the line with the mount in my docker-compose, it seems that the api folder is missing. Any idea how you fixed it?

[Manuel](https://hashnode.com/@Manuel187)

[Feb 10, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860#reply-620507e79e350308247fd268)

[Manuel](https://hashnode.com/@Manuel187) Ok do I don't know if this solution is the right way but I got it working. So for all those who have a similar problem. I have added the following line to my Strapi service:

```
strapi:
      ...
      volumes:
        - strapi:/opt/app/src
```

And created an additional volume in my docker-compose:

```
volumes:
  strapi:
```

[Simen Daehlin](https://hashnode.com/@eventyret)

[Feb 11, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860#reply-62062de4a2be760e35393a65)

[Manuel](https://hashnode.com/@Manuel187) That is a good workaround indeed. You can mount the whole project into the container too. Creating it's separate volume will work as well. Though if files change you won't get a reflection on it in the container.

If you need a reflection, bind the folders to the same folders in the container.

```
strapi:
        ...
        volumes:
          - config:/opt/app/config
```

As though avoiding mounting node\_modules. If your system is different to linux.

[Simen Daehlin](https://hashnode.com/@eventyret)

[Feb 17, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6203dfc69e350308247fb860#reply-620ea0bad589905b41291259)

Sorry for a bit of late reply [Manuel](https://hashnode.com/@Manuel187) If you docker-compose up again I think you need to do --build again to rebuild the image would that not be worth it ?
