modify README
This commit is contained in:
parent
7047404baf
commit
7437dafbf3
2 changed files with 33 additions and 15 deletions
18
README.md
18
README.md
|
@ -49,6 +49,24 @@ The application should be accessible at [http://localhost:8080](http://localhost
|
|||
|
||||
Modify the `docker-compose.yml` file to adjust environment variables, ports, or any other configurations as needed.
|
||||
|
||||
## Upload via Terminal
|
||||
|
||||
~~~
|
||||
curl -X POST -F "image=@/pfad/zur/datei/bild.jpg" http://localhost:8080/upload
|
||||
~~~
|
||||
|
||||
Ersetzen Sie /pfad/zur/datei/bild.jpg durch den tatsächlichen Pfad zu Ihrer Datei und http://localhost:8080/upload durch die URL Ihres Servers und den Endpunkt für den Dateiupload.
|
||||
|
||||
Hier ist eine Erläuterung der Optionen, die in der Curl-Anfrage verwendet werden:
|
||||
|
||||
~~~
|
||||
-X POST: Legt die HTTP-Methode auf POST fest, was in diesem Fall verwendet wird, um die Datei hochzuladen.
|
||||
-F "image=@/pfad/zur/datei/bild.jpg": Teilt Curl mit, dass es sich um ein Formular-Upload handelt (-F), und gibt den Namen des Formularfelds (“image”) sowie den Dateipfad (@/pfad/zur/datei/bild.jpg) an.
|
||||
http://localhost:8080/upload: Die URL des Servers und des Endpunkts, an den die Datei hochgeladen werden soll.
|
||||
~~~
|
||||
|
||||
Führen Sie diese Curl-Anfrage in einem Terminal aus, und die Datei wird an den angegebenen Server hochgeladen.
|
||||
|
||||
## Additional Information
|
||||
|
||||
- This project uses NGINX as a reverse proxy. Ensure that the required networks (`nginx-proxy` and `edge`) are set up externally or adjust the `docker-compose.yml` accordingly.
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Build the application from source
|
||||
FROM golang:1.21.4 AS build-stage
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY *.go ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /picture-uploader
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Build the application from source
|
||||
FROM golang:1.21.4 AS build-stage
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY *.mod ./
|
||||
RUN go mod download
|
||||
|
||||
COPY *.go ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /main
|
||||
|
||||
# Run the tests in the container
|
||||
FROM build-stage AS run-test-stage
|
||||
|
@ -21,10 +21,10 @@ FROM gcr.io/distroless/base-debian11 AS build-release-stage
|
|||
|
||||
WORKDIR /
|
||||
|
||||
COPY --from=build-stage /picture-uploader /picture-uploader
|
||||
COPY --from=build-stage /main /main
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
USER nonroot:nonroot
|
||||
|
||||
ENTRYPOINT ["/picture-uploader"]
|
||||
ENTRYPOINT ["/main"]
|
||||
|
|
Loading…
Reference in a new issue