fix: update docker interface
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -2,19 +2,26 @@ FROM golang:1.25-alpine AS builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apk add --no-cache git build-base
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -o /fes main.go
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=amd64
|
||||
|
||||
FROM alpine:latest
|
||||
RUN go build -ldflags="-X fes/modules/version.gitCommit=$(git rev-parse --short HEAD) -s -w" -o fes
|
||||
|
||||
RUN apk add --no-cache bash lua5.4
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /fes /usr/local/bin/fes
|
||||
COPY --from=builder /src/fes /fes
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["fes", "run", "/app"]
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/fes"]
|
||||
CMD ["run", "/app"]
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
FROM fes:latest
|
||||
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["fes", "run", "/app"]
|
||||
7
examples/hello-with-docker/docker-compose.yml
Normal file
7
examples/hello-with-docker/docker-compose.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
hello:
|
||||
image: git.vxserver.dev/fsd/fes:latest
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./app:/app
|
||||
Reference in New Issue
Block a user