-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.alpine
38 lines (27 loc) · 1012 Bytes
/
Dockerfile.alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM thevlang/vlang:alpine-dev AS builder
# update packages, to reduce risk of vulnerabilities
RUN apk update && apk upgrade
RUN apk --no-cache add upx
# RUN apk cache clean
# copy and build application sources
WORKDIR /src
COPY . .
RUN make build-optimized && make dist
# use vlang alpine-base image,
# otherwise use a standard alpine but add runtime libraries for musl, openssl (and maybe others)
FROM thevlang/vlang:alpine-base AS runtime
LABEL version="1.0.0"
LABEL description="Example vweb (V) webapp Docker Image"
LABEL maintainer="Sandro Martini <[email protected]>"
# update packages, to reduce risk of vulnerabilities
RUN apk update && apk upgrade
WORKDIR /app
COPY --from=builder /src/dist/ .
# RUN ls -la /app
# describe port/s opened in the container
EXPOSE 8000
# add an healthcheck by calling the additional script/application
HEALTHCHECK --interval=60s --timeout=10s --start-period=15s CMD ["./healthcheck"]
# ENTRYPOINT [ "/app/vweb-example" ]
CMD [ "./vweb-example" ]
# end.