Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,11 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

#/tmp
TestRevify.Api/Dockerfiles/tmp/**
#TestRevify.Api/Dockerfiles/tmp/grafana
!.yaml
!.yml
#!.gitignore
20 changes: 9 additions & 11 deletions TestRevify.Api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ ARG LAUNCHING_FROM_VS
ARG FINAL_BASE_IMAGE=${LAUNCHING_FROM_VS:+aotdebug}

# Esta fase se usa cuando se ejecuta desde VS en modo rápido (valor predeterminado para la configuración de depuración)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 80


# Esta fase se usa para compilar el proyecto de servicio
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
# Instalación de las dependencias clang/zlib1g-dev para publicar en nativo
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
clang zlib1g-dev
RUN apk update \
&& apk add build-base zlib-dev
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["TestRevify.Api.csproj", "."]
Expand All @@ -35,14 +34,13 @@ RUN dotnet publish "./TestRevify.Api.csproj" -c $BUILD_CONFIGURATION -o /app/pub
FROM base AS aotdebug
USER root
# Instalación de GDB para admitir la depuración nativa
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gdb
RUN apk update \
&& apk add gdb
USER app

# Esta fase se usa en producción o cuando se ejecuta desde VS en modo normal (valor predeterminado cuando no se usa la configuración de depuración)
FROM ${FINAL_BASE_IMAGE:-mcr.microsoft.com/dotnet/runtime-deps:9.0} AS final
FROM ${FINAL_BASE_IMAGE:-mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine} AS final
WORKDIR /app
EXPOSE 8080
EXPOSE 80
COPY --from=publish /app/publish .
ENTRYPOINT ["./TestRevify.Api"]
14 changes: 14 additions & 0 deletions TestRevify.Api/Dockerfiles/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
services:
web:
container_name: webApi
build: ../
ports:
- "80:80"
environment:
- ASPNETCORE_HTTP_PORTS=80
networks:
- opentelemetry
loki:
container_name: loki
image: grafana/loki:latest
ports:
- "3100:3100"
Expand All @@ -8,6 +18,7 @@ services:
- opentelemetry

grafana:
container_name: grafana
image: grafana/grafana:latest
ports:
- "3000:3000"
Expand All @@ -25,6 +36,7 @@ services:
- opentelemetry

otel-collector:
container_name: otel-collector
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
Expand All @@ -37,6 +49,7 @@ services:
- opentelemetry

prometheus:
container_name: prometheus
image: prom/prometheus:latest
ports:
- "9090:9090"
Expand All @@ -50,6 +63,7 @@ services:
- otel-collector

zipkin:
container_name: zipkin
image: openzipkin/zipkin:latest
ports:
- "9411:9411"
Expand Down
Binary file removed TestRevify.Api/Dockerfiles/tmp/grafana/grafana.db
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading