mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 09:21:25 +00:00
add dockerfile to pows_server
This commit is contained in:
parent
8ca4d5bcbc
commit
d09aa00c4c
2
pow_server/.gitignore
vendored
Normal file
2
pow_server/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
go.sum
|
||||
main
|
23
pow_server/Dockerfile
Normal file
23
pow_server/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
# Start from the latest golang base image
|
||||
FROM golang:latest
|
||||
|
||||
# Set the Current Working Directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
|
||||
RUN go mod download
|
||||
|
||||
# Copy the source from the current directory to the Working Directory inside the container
|
||||
COPY . .
|
||||
|
||||
# Build the Go app
|
||||
RUN go build -o main .
|
||||
|
||||
# Expose port 8080 to the outside world
|
||||
EXPOSE 8080
|
||||
|
||||
# Command to run the executable
|
||||
CMD ["./main"]
|
@ -80,5 +80,5 @@ func handlePOW(w http.ResponseWriter, r *http.Request) {
|
||||
func main() {
|
||||
http.HandleFunc("/powgen", handlePOW)
|
||||
|
||||
log.Fatal(http.ListenAndServe("127.0.0.1:8080", nil))
|
||||
log.Fatal(http.ListenAndServe("0.0.0.0:8080", nil))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user