geerlingguy / beast-challenge

A control system for MrBeast's 1-100 challenge
GNU General Public License v3.0
26 stars 1 forks source link

Issue #42: Dockerize the react frontend app setup. #43

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

This setup is currently failing when I try running it with:

#0 9.938 info  - Using wasm build of next-swc
#0 10.03 warn  - Attempted to load @next/swc-linux-arm64-gnu, but it was not installed
#0 10.03 warn  - Attempted to load @next/swc-linux-arm64-musl, but it was not installed
#0 12.48 Failed to compile.
#0 12.48 
#0 12.48 ./src/components/Question/index.tsx
#0 12.48 Module not found: Can't resolve '../../assets/flash.png'
#0 12.48 
#0 12.48 https://nextjs.org/docs/messages/module-not-found
#0 12.48 
#0 12.48 Import trace for requested module:
#0 12.48 ./src/components/MainWindow/index.tsx
#0 12.48 ./src/pages/index.tsx
#0 12.48 
#0 12.48 
#0 12.48 > Build failed because of webpack errors
#0 12.54 error Command failed with exit code 1.
#0 12.54 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: executor failed running [/bin/sh -c yarn run build]: exit code: 1
geerlingguy commented 1 year ago

Ah... can't copy in the node_modules directory, since that breaks things.

So I am trying to add a .dockerignore file there and it should hopefully take care of things by excluding the node_modules directory when building the Docker container.

kamranpirwani commented 1 year ago

@geerlingguy Can help you dockerize this, will do this tomorrow

geerlingguy commented 1 year ago

@kamranpirwani - Great! It looks like using a .dockerignore doesn't solve it. Probably some fun little React deployment quirk that you would figure out a lot quicker than me ;)

I'll put this on hold and whenever you get a chance you can help get it going. It will be very easy to deploy if we can get it to just build as part of the standard docker-compose setup here.

kamranpirwani commented 1 year ago

I think we can close this in favor of https://github.com/geerlingguy/beast-game/pull/46