---
title: "Comment by Nabeel Shakeel on \"🐳 Docker with Strapi V4 🌟\" | Hashnode"
description: "Hi Simen Daehlin , Thanks for the wonderful article. It helps me a lot in setting up development environment on docker suing Strapi v4. I was facing this error"
url: "https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6322d01007b36072368a03f7"
---

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

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

[Nabeel Shakeel](https://hashnode.com/@nabeel8)

[Sep 15, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6322d01007b36072368a03f7)

Hi [Simen Daehlin](https://hashnode.com/@eventyret), Thanks for the wonderful article. It helps me a lot in setting up development environment on docker suing Strapi v4.

I was facing this error when using this Dockerfile to start starpi:

```
tw-backend  | yarn run v1.22.19
tw-backend  | $ strapi develop
tw-backend  | Starting the compilation for TypeScript files in /opt/app
tw-backend  | [2022-09-15 06:19:31.420] debug: ⛔️ Server wasn't able to start properly.
tw-backend  | [2022-09-15 06:19:31.423] error: Could not load js config file /opt/app/node_modules/@strapi/plugin-upload/strapi-server.js: 
tw-backend  | Something went wrong installing the "sharp" module
tw-backend  | 
tw-backend  | Cannot find module '../build/Release/sharp-linuxmusl-x64.node'
```

So, I solved this issue by by doing these two changes, move node\_modules into opt/app and add install `sharp`

Adding my Dockerfile to save time for those who are facing the same issue

```
FROM node:16-alpine
# Installing libvips-dev for sharp Compatability
RUN apk update && apk add  build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/app
COPY ./package.json ./yarn.lock ./
# ENV PATH /opt/node_modules/.bin:$PATH
RUN yarn config set network-timeout 600000 -g && yarn install
RUN yarn add --verbose --platform=linuxmusl --arch=x64 sharp
# WORKDIR /opt/app
COPY ./ .
RUN yarn build
EXPOSE 1337
CMD ["yarn", "develop"]
```

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

[Sep 15, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6322d01007b36072368a03f7#reply-6322d37d776a69866dd6d3ac)

Thanks the idea is not to move node modules into it as it gives more attack surface, but will re-test it. Did you try the npx tool I created which auto creates the files etc as needed?

[Nabeel Shakeel](https://hashnode.com/@nabeel8)

[Sep 15, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/6322d01007b36072368a03f7#reply-6322d482776a69866dd6d3e1)

[Simen Daehlin](https://hashnode.com/@eventyret) Yes, I used your tool to create Dockerfile and docker-compose.

When I moved node\_modules into `/opt/app` then it works because error is

```
error: Could not load js config file /opt/app/node_modules/@strapi/plugin-upload/strapi-server.js
```
