Skip to content

Commit bc7820e

Browse files
committed
docs: add configuration steps in readme
1 parent b24611d commit bc7820e

File tree

2 files changed

+108
-1
lines changed

2 files changed

+108
-1
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Config Server Repository
22
CONFIG_SERVER_GIT_URI=your_config_server_git_uri
3-
CONFIG_SERVER_GIT_PATH=your_config_server_git_path
3+
CONFIG_SERVER_GIT_PATH=your_config_server_git_path # only if your ConfigServer repository is local
44
# JWT
55
JWT_SECRET_KEY=your_jwt_secret_key
66
# MongoDB

README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,113 @@ Aplicación de microservicios desarrollado con Spring Boot del proyecto Purpost
3939
| [![IntelliJ IDEA][intellijidea-badge]][intellijidea-url] | Entorno de desarrollo del proyecto | 2023.2 Ultimate Edition |
4040

4141

42+
<!-- GETTING STARTED -->
43+
## 🚀 Iniciando el proyecto
44+
45+
Para poner en funcionamiento una copia local de este repositorio, siga los siguientes pasos.
46+
47+
### Requisitos previos
48+
49+
Obligatorio
50+
```txt
51+
JDK >= 17.X
52+
Maven >= 3.X
53+
```
54+
55+
Opcional
56+
```txt
57+
Git
58+
IntelliJ IDEA
59+
Docker
60+
```
61+
62+
### Instalación y configuración
63+
64+
1. Descargue o clone este repositorio.
65+
66+
```sh
67+
git clone https://github.com/misicode/Purpost_Blog-Server
68+
```
69+
70+
2. Instale todas las dependencias de cada microservicio.
71+
72+
```sh
73+
cd [microservice-name]
74+
mvn install
75+
```
76+
77+
3. Descargue o clone el repositorio de configuración.
78+
79+
```sh
80+
git clone https://github.com/misicode/PurPostBlog-ConfigServer
81+
```
82+
83+
### Despliegue
84+
85+
**Manual**
86+
1. En el microservicio `config-server-service`, declare la variable de entorno de ubicación de su repositorio de configuración. Por ejemplo:
87+
1. Si el repositorio es local:
88+
89+
```env
90+
CONFIG_SERVER_GIT_URI=file:///C:\Users\Usuario\Documents\purpost-config-server
91+
```
92+
93+
2. Si el repositorio es remoto:
94+
95+
```env
96+
CONFIG_SERVER_GIT_URI=https://github.com/misicode/PurPostBlog-ConfigServer
97+
```
98+
99+
2. En su repositorio de configuración, reemplace las siguientes variables de entorno de los archivos `.yml` con sus credenciales respectivas.
100+
101+
```env
102+
${JWT_SECRET_KEY} = your_jwt_secret_key
103+
104+
${IMAGE_MONGODB_URI} = your_image_mongodb_uri
105+
${POST_MONGODB_URI} = your_post_mongodb_uri
106+
${USER_MONGODB_URI} = your_user_mongodb_uri
107+
108+
${CLOUDINARY_CLOUD_NAME} = your_cloudinary_cloud_name
109+
${CLOUDINARY_API_KEY} = your_cloudinary_api_key
110+
${CLOUDINARY_API_SECRET} = your_cloudinary_api_secret
111+
```
112+
113+
3. Levante cada microservicio.
114+
115+
116+
**Con Docker**
117+
1. Cree el archivo `.env` como copia del archivo `.env.template` e ingrese sus credenciales respectivas.
118+
119+
```env
120+
# Config Server Repository
121+
CONFIG_SERVER_GIT_URI=your_config_server_git_uri
122+
CONFIG_SERVER_GIT_PATH=your_config_server_git_path # only if your ConfigServer repository is local
123+
# JWT
124+
JWT_SECRET_KEY=your_jwt_secret_key
125+
# MongoDB
126+
IMAGE_MONGODB_URI=your_image_mongodb_uri
127+
POST_MONGODB_URI=your_post_mongodb_uri
128+
USER_MONGODB_URI=your_user_mongodb_uri
129+
# Cloudinary
130+
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
131+
CLOUDINARY_API_KEY=your_cloudinary_api_key
132+
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
133+
```
134+
135+
2. Construya el ejecutable de cada microservicio.
136+
137+
```sh
138+
cd [microservice-name]
139+
mvn clean package -DskipTests
140+
```
141+
142+
3. Construya y levante los contenedores de los microservicios.
143+
144+
```sh
145+
docker compose up -d --build
146+
```
147+
148+
42149
<!-- LICENSE -->
43150
## 💼 Licencia
44151

0 commit comments

Comments
 (0)