32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
# ---------------------------------------------------
|
|
# 1) Builder: compila API, worker y prepara goose
|
|
# ---------------------------------------------------
|
|
FROM golang:1.24 AS builder
|
|
|
|
|
|
RUN apt-get update && apt-get install -y tzdata
|
|
|
|
ENV TZ=America/La_Paz
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
# Configurar el directorio de trabajo dentro del contenedor
|
|
WORKDIR /app
|
|
|
|
# 1.1 Dependencias (caché)
|
|
COPY go.mod go.sum ./
|
|
RUN go mod tidy
|
|
|
|
# 1.2 Código fuente
|
|
COPY . .
|
|
|
|
# Instalar OpenSSL (necesario para generar los certificados)
|
|
#RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copiar el script entrypoint a la carpeta /docker-entrypoint-init.d/ y dar permisos de ejecución
|
|
#COPY scripts/entrypoint.sh /docker-entrypoint-init.d/entrypoint.sh
|
|
#RUN chmod +x /docker-entrypoint-init.d/entrypoint.sh
|
|
|
|
# Configurar el entrypoint para que ejecute el script
|
|
#ENTRYPOINT ["/bin/sh", "/docker-entrypoint-init.d/entrypoint.sh"]
|
|
|
|
# Comando que se ejecutará tras el entrypoint (por ejemplo, levantar la API)
|
|
CMD ["go", "run", "cmd/go-sync-service/main.go"] |