-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update Dockerfile to include lpac builder stage and improve bu…
…ild process
- Loading branch information
Showing
6 changed files
with
63 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.git | ||
.github | ||
.vscode | ||
.editorconfig | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "lpac"] | ||
path = lpac | ||
url = git@github.com:estkme-group/lpac.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,40 @@ | ||
FROM golang:1.22-alpine as builder | ||
# Build: lpac | ||
FROM alpine:3.20 AS lpac-builder | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache git gcc cmake make musl-dev curl-dev | ||
|
||
COPY . . | ||
|
||
RUN set -ex \ | ||
&& cd lpac \ | ||
&& cmake . -DLPAC_WITH_APDU_PCSC=off -DLPAC_WITH_APDU_AT=off \ | ||
&& make -j$(nproc) | ||
|
||
# Build: estkme-cloud | ||
FROM golang:1.22-alpine as estkme-cloud-builder | ||
|
||
WORKDIR /app | ||
|
||
ARG VERSION | ||
|
||
COPY . . | ||
|
||
RUN set -ex \ | ||
&& CGO_ENABLED=0 go build -trimpath -ldflags="-w -s -X main.Version=${VERSION}" -o estkme-cloud main.go | ||
|
||
FROM alpine:latest | ||
# Production | ||
FROM alpine:3.20 as production | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/estkme-cloud /app/estkme-cloud | ||
COPY --from=lpac-builder /app/lpac/output/lpac /app/lpac | ||
COPY --from=estkme-cloud-builder /app/estkme-cloud /app/estkme-cloud | ||
|
||
RUN set -ex \ | ||
&& apk add --no-cache gcompat ca-certificates pcsc-lite-libs libcurl \ | ||
&& update-ca-certificates \ | ||
&& chmod +x /app/estkme-cloud | ||
&& apk add --no-cache libcurl | ||
|
||
EXPOSE 1888 | ||
|
||
CMD ["/app/estkme-cloud"] | ||
CMD ["/app/estkme-cloud", "--dont-download", "--dir=/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters