# deploy-tool **Repository Path**: MYZ9/deploy-tool ## Basic Information - **Project Name**: deploy-tool - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-22 - **Last Updated**: 2026-01-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Go Concurrent File Processor This application is a Go-based web server that allows you to upload files and execute associated scripts concurrently. It features a web interface with three distinct cards, each capable of handling an independent file upload and script execution, with real-time progress and log streaming. The UI is localized in Chinese. ## Setup and Running the Application ### 1. Prerequisites * **Go:** You need Go installed (version 1.21 or newer recommended). * **Docker:** Docker Desktop or Docker Engine installed and running. * **Windows Environment:** This guide assumes you are running on a Windows machine. ### 2. Generate Linux Executable (Cross-Compilation) Before building the Docker image, you need to generate a Linux executable of the Go application. Open your terminal in the project root directory and run the following command: ```bash GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o server . ``` This command tells Go to compile the `main.go` application for a Linux operating system (`GOOS=linux`) on an AMD64 architecture (`GOARCH=amd64`), and to produce a statically linked binary (`CGO_ENABLED=0`) named `server`. ### 3. Build the Docker Image After generating the `server` executable, you can build the Docker image. First, we need to modify the `Dockerfile` to expect a pre-built binary. **Original `Dockerfile`:** ```dockerfile # ---- Build Stage ---- FROM golang:1.21-alpine AS builder WORKDIR /app COPY main.go . RUN CGO_ENABLED=0 GOOS=linux go build -v -o server . # ---- Final Stage ---- FROM alpine:latest WORKDIR /app COPY --from=builder /app/server . COPY templates ./templates COPY scripts ./scripts EXPOSE 8080 CMD ["./server"] ``` **Modified `Dockerfile`:** ```dockerfile # ---- Final Stage (using pre-built binary) ---- FROM alpine:latest WORKDIR /app # Copy the pre-built Linux executable from your host machine into the container. COPY server . # Copy the templates and scripts directories, which are needed by the application at runtime. COPY templates ./templates COPY scripts ./scripts # Expose port 8080 to the outside world. EXPOSE 8080 # Command to run the executable. CMD ["./server"] ``` Now, with the `server` binary present and the `Dockerfile` modified, build the Docker image by running this command in your project's root directory: ```bash docker build -t go-concurrent-uploader . ``` ### 4. Run the Docker Container Once the image is built, you can run the application in a Docker container: ```bash docker run -p 8080:8080 --rm --name go-uploader-instance go-concurrent-uploader ``` * `-p 8080:8080`: Maps the container's port 8080 to your local port 8080. * `--rm`: Automatically removes the container when it's stopped. * `--name go-uploader-instance`: Assigns a name to your running container instance. ### 5. Access the Application Open your web browser and navigate to: [http://localhost:8080](http://localhost:8080) You will see the three cards, allowing you to upload different files and run their associated scripts concurrently.