mirror of https://github.com/JustKato/FreePad.git
Dockerfile Build Improvements
This commit is contained in:
parent
0f5a352fc6
commit
1d50efe3c6
20
Dockerfile
20
Dockerfile
|
@ -1,9 +1,25 @@
|
||||||
|
FROM golang:1.18 as builder
|
||||||
|
|
||||||
|
# Go into the app dir
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy all of the source to /app
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# Download dependencies
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
# Build
|
||||||
|
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o freepad .
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
LABEL version="1.4.0"
|
LABEL version="1.4.0"
|
||||||
|
|
||||||
# Copy the distribution files
|
# Copy the files from the builder to the new image
|
||||||
COPY ./dist /app
|
COPY --from=builder /app/freepad /app/freepad
|
||||||
|
COPY --from=builder /app/templates /app/templates
|
||||||
|
COPY --from=builder /app/static /app/static
|
||||||
|
|
||||||
# Make /app the work directory
|
# Make /app the work directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
Loading…
Reference in New Issue