saasforge / open-source-saas-boilerpate

Free SaaS boilerplate (Python/PostgreSQL/ReactJS/Webpack)
https://www.saasforge.dev
MIT License
816 stars 120 forks source link

docker-compose up fails #7

Open ronreiter opened 4 years ago

ronreiter commented 4 years ago

Error: Cannot find module '/app/webpack.dev.js'

Happens because webpack.dev.js and webpack.common.js are not copied before the npm command. Need to fix the dockerfile.

saasforge commented 4 years ago

Hi, thanks for reporting this issue. Let me try to figure out how it can be fixed.

saasforge commented 4 years ago

@mandrews can you please look at this issue? Thanks!

ericvanular commented 4 years ago

@saasforge any idea how to fix this? Trying to use docker compose currently but stuck here

saasforge commented 4 years ago

@ericvanular Can you please describe step-by-step your problem? Thanks!

ericvanular commented 4 years ago

@saasforge same issue as @ronreiter

I run docker-compose up and it throws an error with --> Error: Cannot find module '/app/webpack.dev.js'

saasforge commented 4 years ago

I'm not very familiar with docker but I think it's because there is no such folder app. What is /app folder at all? If it's a root one, where do you define it? If it's defined by default, you probably should change it to just / Can you please try? P.S. webpack.dev.js can be found the root directory so probably for some reason docker looks it in non-existing folder app. P.S.2. Okay, I see the dockerfile has the following lines:

WORKDIR /app COPY . /app

I think if your workdir is not app, it shouldn't work?

ericvanular commented 4 years ago

Thanks @saasforge, I'm not super familiar with Docker either but the error is in Step 7/10: (RUN npm install --global npm && npm update && npm install && npm run dev)

I'll try to change the workdir name and report back

ericvanular commented 4 years ago

Was able to get the Docker image to build by switching the order of Step 7 and 8

COPY . /app

should be before

RUN npm install --global npm && \ npm update && \ npm install && \ npm run dev

saasforge commented 4 years ago

@ericvanular Thanks a lot! Do you want to make update to the dockfile or you want me to do that?

ericvanular commented 4 years ago

No worries, I can make a PR in a bit

saasforge commented 4 years ago

Cool, thanks!

azziz-errime commented 4 years ago

Hi there,

The suggested change doesn't appear in the code. Is it normal?

saasforge commented 4 years ago

No, it's not normal, it's just never been changed. Please feel free to create PR.

saasforge commented 4 years ago

Fixed in 87d795580748d942ab43ea23e2462cbf97b3f2b5 Please try and let us know if there is still an issue.