Skip to content

quangtruongdit/cc-react-admin-ui

 
 

Repository files navigation

Using docker compose to run the app locally

This command is required to run at the first time or whenever we change docker-compose.yaml

docker-compose up --build --no-recreate -d

The next time, we will only run:

docker-compose up -d

List containers:

docker-compose ps

Log into the container and run the following command:

docker exec -it vite_docker sh

After that run:

npm i && npm run dev

Finnaly, open browser and run:

http://localhost:8080

How to Dockerize images:

  1. Create Dockerfile as in repository.
  2. Dockerize iamge
docker build -t cc-react-admin-ui:latest .
  1. Run docker image
docker run -d -p 5173:5173 cc-react-admin-ui:latest

Deploy to Github

  • Set up vite.config.ts base: "/[REPO_NAME]/"
base: "/cc-react-admin-ui/"
image
  • Visit Actions to view deploy status
image
  • Visit Pages to publish the app
image
  • The app will be accessible from "https://{your github account}.github.io/cc-react-admin-ui/"

References:

https://dev.to/ysmnikhil/how-to-build-with-react-or-vue-with-vite-and-docker-1a3l https://github.com/ErickKS/vite-deploy#04-create-githubworkflowsdeployyml-and-add-the-code-bellow

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 78.1%
  • SCSS 18.5%
  • HTML 2.4%
  • Dockerfile 1.0%