This repo is an example of how to get Docker Compose to build production ready code while concurrently being able to locally create frontend dev environment that can interact with backend.
- Docker ENV variables with VITE are converted to arguments in the build script to be loaded into runtime ENV varaibles
- Docker volume for backend is persisted to preserve database entries.
- Install docker & docker-compose
- Customize .env variables in the root directory
- run
docker-compose up -d --build
The production ready environment is available at http://localhost
- navigate to ./frontend
- Customize .env VITE_API_PORT in /frontend directory to match the build environment
- run
npm run dev
The frontend dev environment is available at http://localhost:5173 but still interacts with backend api at port 3001
- docker
- docker-compose
FRONTEND
- vue 3
- vite
- axios
DATABASE
- mongodb
BACKEND
- express
- mongoose