This is a web application that allows users to take a picture with their camera or upload a photo to try on various hairstyles and colors using the Gemini AI model. The application is containerized using Docker and orchestrated with Docker Compose for easy setup and deployment.
Before you begin, ensure you have the following installed on your system:
- Docker
- Docker Compose (This is included with Docker Desktop)
You will also need a Gemini API Key. You can get one from Google AI Studio.
Follow these steps to get the application running locally.
In the root directory of the project, create a new file named .env.
Open the .env file and add your Gemini API key in the following format:
API_KEY=YOUR_GEMINI_API_KEYReplace YOUR_GEMINI_API_KEY with your actual key. This file is included in .dockerignore and should not be committed to version control.
Open your terminal in the project's root directory and run the following command:
docker-compose up --buildThis command will:
- Build the Docker image for the application based on the
Dockerfile. - Pass your
API_KEYsecurely from the.envfile into the build process. - Create and start a container to serve the web app on port 8080.
To run the container in the background (detached mode), you can add the -d flag:
docker-compose up --build -dOnce the build is complete and the container is running, open your web browser and navigate to:
To stop the running application and remove the container, press Ctrl + C in the terminal where Docker Compose is running. If you are running in detached mode, use the following command from the project root:
docker-compose down