feat(cicd): added redis
This commit is contained in:
parent
54c45ac3bc
commit
6955216568
2 changed files with 22 additions and 4 deletions
|
|
@ -40,6 +40,22 @@ services:
|
||||||
retries: 5
|
retries: 5
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:8.4.0-alpine
|
||||||
|
container_name: redis
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
restart: always
|
||||||
|
command: ["redis-server", "--appendonly", "yes"]
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 5s
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
|
||||||
nyanimedb-backend:
|
nyanimedb-backend:
|
||||||
image: meowgit.nekoea.red/nihonium/nyanimedb-backend:latest
|
image: meowgit.nekoea.red/nihonium/nyanimedb-backend:latest
|
||||||
container_name: nyanimedb-backend
|
container_name: nyanimedb-backend
|
||||||
|
|
@ -51,8 +67,8 @@ services:
|
||||||
RABBITMQ_URL: ${RABBITMQ_URL}
|
RABBITMQ_URL: ${RABBITMQ_URL}
|
||||||
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
||||||
AUTH_ENABLED: ${AUTH_ENABLED}
|
AUTH_ENABLED: ${AUTH_ENABLED}
|
||||||
ports:
|
# ports:
|
||||||
- "8080:8080"
|
# - "8080:8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
|
|
@ -68,8 +84,8 @@ services:
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
DATABASE_URL: ${DATABASE_URL}
|
||||||
SERVICE_ADDRESS: ${SERVICE_ADDRESS}
|
SERVICE_ADDRESS: ${SERVICE_ADDRESS}
|
||||||
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
||||||
ports:
|
# ports:
|
||||||
- "8082:8082"
|
# - "8082:8082"
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
networks:
|
networks:
|
||||||
|
|
@ -89,6 +105,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
rabbitmq_data:
|
rabbitmq_data:
|
||||||
|
redis_data:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nyanimedb-network:
|
nyanimedb-network:
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@ func (s Server) GetImpersonationToken(ctx context.Context, req auth.GetImpersona
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Body.UserId != nil {
|
if req.Body.UserId != nil {
|
||||||
|
// TODO: check user existence
|
||||||
if user_id != "" && user_id != fmt.Sprintf("%d", *req.Body.UserId) {
|
if user_id != "" && user_id != fmt.Sprintf("%d", *req.Body.UserId) {
|
||||||
log.Error("user_id and external_d are incorrect")
|
log.Error("user_id and external_d are incorrect")
|
||||||
// TODO: 405
|
// TODO: 405
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue