-
Make sure you already have Node, Docker, Docker Compose installed in your machine
-
Run the following command:
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
- Create Dockerfile as in repository.
- Dockerize iamge
docker build -t cc-react-admin-ui:latest .
- Run docker image
docker run -d -p 5173:5173 cc-react-admin-ui:latest
- Set up vite.config.ts base: "/[REPO_NAME]/"
base: "/cc-react-admin-ui/"
-
Create deploy.yml .github/workflows/deploy.yml
-
Enable workflows permission

- Visit Actions to view deploy status

- Visit Pages to publish the app

- The app will be accessible from "https://{your github account}.github.io/cc-react-admin-ui/"
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