Make sure you have the following installed on your machine:
- Docker
- Docker Compose
Follow these steps to set up and deploy the project:
-
Clone the repository:
https://github.com/ireneeromero/user_connection.git cd user_connection
-
Set up environment variables:
You don't need to create
.env
files manually. The environment variables are defined directly in thedocker-compose.yml
file. Your must change theAPI_HOST
.For
userAPI
:DB=postgresql://user:password@db:5432/user_connections API_HOST=0.0.0.0 API_PORT=8000
-
Build and run the containers:
docker compose up --build
This command will build the Docker images and start the containers for PostgreSQL and FastAPI.
- The FastAPI API will be available at
http://API_HOST:API_PORT
- The FastAPI API will be available at
Open a new terminal and build the docker image
```bash
cd user-gui
docker build -f Dockerfile.web -t user-connection:1.0.0 .
```
After that, create a .env
file and fill the environment variables from the provided template.
You must change your API_URL
with the IP where the API has been allocated on your machine.
```API_URL=http://API_HOST:API_PORT```
Then, run the docker container as follows:
```bash
docker run -p 3001:3000 --env-file .env -d user-connection:1.0.0
```
-
Access the application:
- The Next.js web interface will be available at
http://YOUR_IP:3001
- The Next.js web interface will be available at