---
title: "Comment by Usash on \"🐳 Docker with Strapi V4 🌟\" | Hashnode"
description: "After following all step by step my project run successfully in docker container. but I want to run strapi project locally by yarn develop command and the postg"
url: "https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957"
---

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

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

[Usash](https://hashnode.com/@Usash)

[Feb 18, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957)

After following all step by step my project run successfully in docker container. but I want to run strapi project locally by _yarn develop_ command and the postgres will be run in docker container by _docker-compose -d up postgresDB_. The Docker is completely fine and do his job as run postgresDB alone. but when i try _yarn develop_ i got error and crash my project ![1.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1645209040786/kCiqvawSS.png)

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

[Feb 18, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957#reply-620fe77c8f26523301cb562b)

You need to yarn install first I'm guessing? It also explains how to install sharp for windows as well

[Usash](https://hashnode.com/@Usash)

[Feb 19, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957#reply-6210f422c6ed3906e81c2584)

[Simen Daehlin](https://hashnode.com/@eventyret) Yarn is already installed and also all the dependencies installed by yarn. but still could not connect with postgresDB which is running in docker.

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

[Feb 19, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957#reply-621176b0e2db563535e36a6d)

According to the logs sharp hasn't been installed correctly. So if this Windows check the output. [Usash](https://hashnode.com/@Usash)

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

[Feb 28, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957#reply-621d1415c07e2ceec785ffd4)

What is inside your `.env` for host? [Usash](https://hashnode.com/@Usash)

[Nils K.](https://hashnode.com/@NKODING)

[Mar 17, 2022](https://hashnode.com/posts/docker-with-strapi-v4/61dcb820cda0d0294b69c3cd/comment/620fe5e49375bf259a97b957#reply-623330296647c71acb640140)

I needed to change the Dockerfile a bit (adding -y):

RUN apt-get update && apt-get install -y libvips-dev

and also yarn.lock was not found so I commented it out. But now I get more errors running the docker-compose up -d:

strapi | yarn run v1.22.17 strapi | $ strapi develop strapi | Knex: run strapi | $ npm install pg --save strapi | Cannot find module 'pg' strapi | Require stack: strapi | - /opt/node\_modules/knex/lib/dialects/postgres/index.js strapi | - /opt/node\_modules/knex/lib/knex-builder/internal/config-resolver.js strapi | - /opt/node\_modules/knex/lib/knex-builder/Knex.js strapi | - /opt/node\_modules/knex/lib/index.js strapi | - /opt/node\_modules/knex/knex.js strapi | - /opt/node\_modules/@strapi/database/lib/index.js strapi | - /opt/node\_modules/@strapi/strapi/lib/Strapi.js strapi | - /opt/node\_modules/@strapi/strapi/lib/index.js strapi | - /opt/node\_modules/@strapi/strapi/lib/commands/develop.js strapi | - /opt/node\_modules/@strapi/strapi/bin/strapi.js
