OpenBCca / openbc-web

https://openbcca.github.io/openbc-web/
1 stars 2 forks source link

#36 Add local docker setup with hot-reload #51

Open LeoQiu981112 opened 8 months ago

LeoQiu981112 commented 8 months ago

Setup OpenBC to run in docker container #36

Added corresponding docker files for project, with hot-reload and pre-render updated wiki manually

umsu2 commented 8 months ago

there is many issues with this approach. it is not a good production build because you shouldnt run npm install in prod build. better approach would be to build in pipeline or multistep build then copy the final files into the prod build. also the file mounting is a little weird not sure what is happening there.

LeoQiu981112 commented 8 months ago

there is many issues with this approach. it is not a good production build because you shouldnt run npm install in prod build. better approach would be to build in pipeline or multistep build then copy the final files into the prod build. also the file mounting is a little weird not sure what is happening there.

This ticket is meant for dev/local environment only, and the mounting is used for enabling next.js hot reload as per the ticket requirement. The ask/requirement is as follows.

Task Setup OpenBC to run in Docker Container Update 'npm start' command to run docker instance Ensure that changes to files are deployed into the container (hot reload) Create Wiki on how to install Docker locally Deployment into container should be based on pre-rendered pages Note: This change is only to local development. Wiki pages cannot support docker.

SamHuo213 commented 8 months ago

@LeoQiu981112 , still looking at this.

Hold off on changes.

SamHuo213 commented 8 months ago

@LeoQiu981112, @umsu2 ,

The current configuration is confusing. Could we simplify it down?

docker-compose.yml

image

next.config.js

image

Dockerfile

image

LeoQiu981112 commented 8 months ago

@LeoQiu981112, @umsu2 ,

The current configuration is confusing. Could we simplify it down?

docker-compose.yml

image

next.config.js

image

Dockerfile

image

simplified the configs as requested. I think for windows systems might need to run npm run lint first before building