From 31cf9a4454480d3a352a6ca20dd489b8a661fa31 Mon Sep 17 00:00:00 2001 From: "n.nakhostin" Date: Sun, 31 Aug 2025 16:48:08 +0330 Subject: [PATCH] Refactor Dockerfile and Remove iat.yaml Configuration - Updated the Dockerfile to change the working directory to /app and streamline the build process for the web application. - Removed the iat.yaml configuration file, simplifying the configuration management and reducing complexity in the container setup. - Adjusted the entry point and exposed port to align with standard practices, ensuring the application runs on port 80. --- cmd/web/Dockerfile | 15 +++++++------- cmd/web/iat.yaml | 50 ---------------------------------------------- 2 files changed, 7 insertions(+), 58 deletions(-) delete mode 100644 cmd/web/iat.yaml diff --git a/cmd/web/Dockerfile b/cmd/web/Dockerfile index ed39918..b0acfab 100644 --- a/cmd/web/Dockerfile +++ b/cmd/web/Dockerfile @@ -3,21 +3,20 @@ ARG BASH_VERSION=5.0 FROM golang:${GO_VERSION} AS go-builder -WORKDIR /go/src/company/tm_back +WORKDIR /app COPY . . -COPY cmd/web/iat.yaml /go/bin/config.yaml RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o web-build ./cmd/web/main.go FROM bash:${BASH_VERSION} RUN apk --no-cache add busybox-suid curl rsync tzdata tcpdump tree ca-certificates s-nail \ - && ln -s /usr/bin/mail /usr/bin/s-nail \ - && mkdir -p /go/bin/media /go/bin/log /go/bin/config -WORKDIR /go/bin + && ln -s /usr/bin/mail /usr/bin/s-nail -COPY --from=go-builder /go/src/company/tm_back/web-build . +WORKDIR /app -EXPOSE 8090 +COPY --from=go-builder /app/web-build . -ENTRYPOINT /go/bin/web-build +EXPOSE 80 + +ENTRYPOINT /app/web-build diff --git a/cmd/web/iat.yaml b/cmd/web/iat.yaml deleted file mode 100644 index 281a8a7..0000000 --- a/cmd/web/iat.yaml +++ /dev/null @@ -1,50 +0,0 @@ -server: - host: "0.0.0.0" - port: 80 - timeout: 30s - read_timeout: 10s - write_timeout: 10s - -database: - mongodb: - uri: "mongodb://mongo:27017" - name: "tender_management" - timeout: 10s - max_pool_size: 100 - -cache: - redis: - host: "redis" - port: 6379 - password: "" - db: 0 - pool_size: 10 - -user_authorization: - jwt: - access_secret: "44a51a556e5e987fe35559d40cefc08dde894df6f70a7512caa444e72bee7b1b" - refresh_secret: "c99009dd58f9a398118afd8f3eb7f1ba38eba33001c93cb45aa6cb88e0582f36" - access_expires_in: 3600 # 1 hour in seconds - refresh_expires_in: 2592000 # 30 days in seconds - -customer_authorization: - jwt: - access_secret: "78db1387c47a97a7faea439fc66806282d661fe4c0cc0e893147c677d2b89aa8" - refresh_secret: "84e6d4e375d3acfb40030e08756249217955aa40a6816369c64b06666ea74cba" - access_expires_in: 3600 # 1 hour in seconds - refresh_expires_in: 2592000 # 30 days in seconds - -logging: - level: "info" - format: "json" - output: "file" # stdout, stderr, file - file: - path: "./logs/app.log" - max_size: 100 # Max size in MB before rotation - max_backups: 5 # Number of backup files to keep - max_age: 30 # Max age in days to keep log files - compress: true # Compress rotated files - -rate_limiting: - requests_per_minute: 100 - burst: 20 \ No newline at end of file