- Docker: Ensure Docker is installed on your system. You can download and install Docker from Docker's official website.
git clone <repository-url>
cd <repository-directory>
- If your application requires environment variables create a
.envfile in the root of the repository. Use.env.exampleprovided in the repository as a template. - Modify
.envfile as per your environment configuration.
Generate a GitHub Personal Access Token (PAT) named GHCR_PAT with the following permissions:
read:packagesfor accessing packages in GitHub Container Registry (GHCR).
To generate the token:
- Go to your GitHub account.
- Navigate to
Settings>Developer settings>Personal access tokens. - Click on
Generate new token. - Give your token a name (e.g.,
GHCR_PAT). - Select the scope or permissions (
read:packagesandwrite:packages). - Click
Generate token. - Important: Copy the generated token. You won't be able to see it again!
To securely use your GHCR_PAT in GitHub Actions workflows, you need to add it as a repository secret:
- Go to your GitHub repository.
- Click on
Settingstab. - In the left sidebar, click on
Secrets. - Click on
New repository secret. - Name the secret
GHCR_PAT. - Paste the generated PAT into the
Valuefield. - Click
Add secret.
Now, your GitHub Actions workflows can securely access Docker images from GitHub Container Registry using the GHCR_PAT token.
- Ensure you have the
docker-compose.ymlfile at the root of your repository.
docker-compose up
This command will:
- Pull required Docker images from GitHub Packages.
- Build and start all services defined in the
docker-compose.ymlfile.
- Once Docker Compose has successfully started all services, you should be able to access your application:
- Frontend: Open a web browser and go to `http://localhost:3000
- Backend: API endpoints should be accessible at `http://localhost:4000
- To stop the application and shut down all services:
docker-compose down
- Troubleshooting: If you encounter issues during setup or running the application, check Docker logs (
docker-compose logs) for error messages. - Customization: Modify the
docker-compose.ymlor.envfiles as needed to suit different environments or configurations.