Перенести приложение и инфраструктуру из лабораторной 4

This commit is contained in:
Dima
2026-11-04 19:30:45 +03:00
parent 276dbdad8a
commit 9dfb3e5fc4
99 changed files with 10383 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
global
# Operator access only inside this container; no host port is published.
stats socket ipv4@127.0.0.1:9999 level admin
log stdout format raw local0
maxconn 1024
defaults
log global
mode http
option httplog
timeout connect 1s
timeout client 35s
timeout server 35s
timeout check 1s
# Let the client decide which failed POST is safe to repeat.
retries 0
# Docker returns the current addresses of all containers of the api service.
resolvers docker
nameserver docker_dns 127.0.0.11:53
accepted_payload_size 8192
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 1s
hold obsolete 1s
hold nx 1s
hold timeout 1s
hold refused 1s
hold other 1s
frontend api_entry
bind :8080
default_backend api_replicas
backend api_replicas
balance roundrobin
option httpchk GET /health/ready
http-check expect status 200
# Separate slots receive distinct Docker DNS addresses. No sticky sessions.
server-template api "${API_REPLICAS}" "api:${APP_PORT}" check inter 1s fall 2 rise 2 resolvers docker resolve-prefer ipv4 init-addr libc,none
# Local teaching aid: backend addresses, UP/DOWN state and request counters.
listen statistics
bind :8404
stats enable
stats show-legends
stats uri /stats
stats refresh 2s
+19
View File
@@ -0,0 +1,19 @@
FROM golang:1.24.2-bookworm AS builder
WORKDIR /source
RUN git init . \
&& git remote add origin https://github.com/minio/minio.git \
&& git fetch --depth 1 origin 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e \
&& git checkout --detach FETCH_HEAD
RUN CGO_ENABLED=0 go build -trimpath \
-ldflags="-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e" \
-o /out/minio .
FROM debian:12.15-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system storage && useradd --system --gid storage storage \
&& mkdir /data && chown storage:storage /data
COPY --from=builder /out/minio /usr/local/bin/minio
USER storage:storage
ENTRYPOINT ["minio"]
CMD ["server", "/data", "--console-address", ":9001"]