Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions auth-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.19
WORKDIR /auth-api
COPY . .
ENV GO111MODULE=on
RUN go mod init github.com/bortizf/microservice-app-example/tree/master/auth-api
RUN go mod tidy
RUN go build
ENV JWT_SECRET=PRFT
ENV AUTH_API_PORT=8000
EXPOSE ${AUTH_API_PORT}
ENV USERS_API_ADDRESS=http://users-api:8083
CMD [ "./auth-api" ]
31 changes: 31 additions & 0 deletions auth-api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-api
namespace: distribuidos
labels:
app: auth-api
spec:
replicas: 2
selector:
matchLabels:
app: auth-api
type: auth-api
template:
metadata:
labels:
app: auth-api
type: auth-api
spec:
containers:
- name: auth-api
image: arturodiaz02/microservice-app-example-auth
ports:
- containerPort: 8000
env:
- name: REDIS_HOST
value: redis
- name: REDIS_PORT
value: "6379"
- name: REDIS_CHANNEL
value: log_channel
14 changes: 14 additions & 0 deletions auth-api/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: auth-api
namespace: distribuidos

spec:
selector:
app: auth-api
ports:
- protocol: TCP
port: 8000
targetPort: 8000
name: http
27 changes: 27 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#FROM node:20-alpine
#WORKDIR /app
#COPY . .
#ENV AUTH_API_ADDRESS=http://127.0.0.1:8000
#ENV TODOS_API_ADDRESS=http://127.0.0.1:8082
#ENV PORT=8080
#RUN npm install node-sass@9.0
#RUN npm run build
#CMD [ "npm start" ]
FROM node:8.17.0

# Establecer el directorio de trabajo dentro del contenedor
WORKDIR /app

# Copiar el archivo package.json y package-lock.json (si existe)
COPY . .

# Instalar las dependencias
RUN npm install
# Compilar la aplicación
RUN npm run build

ENV PORT=8080
ENV AUTH_API_ADDRESS=http://auth-api:8000
ENV TODOS_API_ADDRESS=http://todos-api:8082

CMD ["npm", "start"]
24 changes: 24 additions & 0 deletions frontend/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: distribuidos
labels:
app: frontend
spec:
replicas: 2
selector:
matchLabels:
app: frontend
type: frontend
template:
metadata:
labels:
app: frontend
type: frontend
spec:
containers:
- name: frontend
image: estebanm1812/frontend:latest
ports:
- containerPort: 8080
14 changes: 14 additions & 0 deletions frontend/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: frontend
namespace: distribuidos

spec:
selector:
app: frontend
ports:
- protocol: TCP
port: 8080
targetPort: 8080
name: http
9 changes: 9 additions & 0 deletions log-message-processor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.6
WORKDIR /app
COPY . .
RUN pip3 install -r requirements.txt
EXPOSE 6029
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV REDIS_CHANNEL=log_channel
CMD ["python3", "main.py"]
38 changes: 38 additions & 0 deletions log-message-processor/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: log-message
namespace: distribuidos
labels:
app: log-message
spec:
replicas: 2
selector:
matchLabels:
app: log-message
type: log-message
template:
metadata:
labels:
app: log-message
type: log-message
spec:
containers:
- name: log-message
image: arturodiaz02/microservice-app-example-logs
ports:
- containerPort: 6029
env:
- name: GO111MODULE
value: "on"
- name: JWT_SECRET
value: PRFT
- name: AUTH_API_PORT
value: "8000"
- name: REDIS_HOST
value: "redis"
- name: REDIS_PORT
value: "6379"
- name: REDIS_CHANNEL
value: log_channel

13 changes: 13 additions & 0 deletions log-message-processor/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: Service
apiVersion: v1
metadata:
name: log-message-procesor
namespace: distribuidos
spec:
selector:
app: log-message-procesor
ports:
- protocol: TCP
port: 6029
targetPort: 6029
name: http
24 changes: 24 additions & 0 deletions redis/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: distribuidos
labels:
app: redis
spec:
replicas: 2
selector:
matchLabels:
app: redis
type: redis
template:
metadata:
labels:
app: redis
type: redis
spec:
containers:
- name: redis
image: redis/redis-stack-server:latest
ports:
- containerPort: 6379
14 changes: 14 additions & 0 deletions redis/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: redis
namespace: distribuidos

spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6029
targetPort: 6029
name: http
16 changes: 16 additions & 0 deletions todos-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:10-alpine
WORKDIR /home/node/app
COPY . .
RUN npm install

ENV AUTH_API_ADDRESS=http://authapi:8000
ENV TODOS_API_ADDRESS=http://todosapi:8082

ENV TODO_API_PORT=8082
ENV JWT_SECRET=PRFT
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV REDIS_CHANNEL=log_channel
EXPOSE ${TODO_API_PORT}

CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion todos-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ npm install
```
## Running
```
JWT_SECRET=PRFT TODO_API_PORT=8082 npm start
JWT_SECRET=PRFT TODO_API_PORT=8082
```

## Usage
Expand Down
34 changes: 34 additions & 0 deletions todos-api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todos-api
namespace: distribuidos
labels:
app: todos-api
spec:
replicas: 2
selector:
matchLabels:
app: todos-api
type: todos-api
template:
metadata:
labels:
app: todos-api
type: todos-api
spec:
containers:
- name: todos-api
image: arturodiaz02/microservice-app-example-todos
ports:
- containerPort: 8082
env:
- name: JWT_SECRET
value: PRFT
- name: REDIS_HOST
value: "redis"
- name: REDIS_PORT
value: "6379"
- name: REDIS_CHANNEL
value: log_channel

14 changes: 14 additions & 0 deletions todos-api/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: todos-api
namespace: distribuidos

spec:
selector:
app: todos-api
ports:
- protocol: TCP
port: 8082
targetPort: 8082
name: http
10 changes: 10 additions & 0 deletions users-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM openjdk:8-jdk
WORKDIR /app
COPY . .
ENV SPRING_ZIPKIN_BASE_URL=http://zipkin:9411
ENV JWT_SECRET=PRFT
ENV SERVER_PORT=8083
EXPOSE ${SERVER_PORT}
RUN ./mvnw clean install
CMD [ "java", "-jar", "target/users-api-0.0.1-SNAPSHOT.jar"]

32 changes: 32 additions & 0 deletions users-api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: users-api
namespace: distribuidos
labels:
app: users-api
spec:
replicas: 2
selector:
matchLabels:
app: users-api
type: users-api
template:
metadata:
labels:
app: users-api
type: users-api
spec:
containers:
- name: users-api
image: arturodiaz02/microservice-app-example-users
ports:
- containerPort: 8083
env:
- name: SPRING_ZIPKIN_BASE_URL
value: http://zipkin:9411
- name: JWT_SECRET
value: PRFT
- name: SERVER_PORT
value: "8083"

14 changes: 14 additions & 0 deletions users-api/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: users-api
namespace: distribuidos

spec:
selector:
app: users-api
ports:
- protocol: TCP
port: 8083
targetPort: 8083
name: http