I have no idea what the fuck I'm doing
This commit is contained in:
parent
1f50ee3722
commit
9ee1291d43
2 changed files with 5 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
# use a minimal base image
|
# use a minimal base image
|
||||||
FROM golang:1.21 AS builder
|
FROM golang:1.23 AS builder
|
||||||
|
|
||||||
# set the working directory in the container
|
# set the working directory in the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -8,7 +8,7 @@ WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# build the go server
|
# build the go server
|
||||||
RUN go mod tidy && go build -o server
|
RUN go mod tidy && go build -o codex-server
|
||||||
|
|
||||||
# create a smaller final image
|
# create a smaller final image
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
@ -16,10 +16,10 @@ FROM alpine:latest
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|
||||||
# copy the built binary from the builder stage
|
# copy the built binary from the builder stage
|
||||||
COPY --from=builder /app/server .
|
COPY --from=builder /app/codex-server .
|
||||||
|
|
||||||
# expose the port (match your go server's listening port)
|
# expose the port (match your go server's listening port)
|
||||||
EXPOSE 61594
|
EXPOSE 61594
|
||||||
|
|
||||||
# run the go server
|
# run the go server
|
||||||
CMD ["./server"]
|
CMD ["./codex-server"]
|
||||||
2
main.go
2
main.go
|
|
@ -167,5 +167,5 @@ func main() {
|
||||||
|
|
||||||
|
|
||||||
log.Println("Serving on :", PORT)
|
log.Println("Serving on :", PORT)
|
||||||
http.ListenAndServe(fmt.Sprintf("127.0.0.1:%d", PORT), nil)
|
http.ListenAndServe(fmt.Sprintf(":%d", PORT), nil)
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue