forked from erebe/wstunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (24 loc) · 775 Bytes
/
Dockerfile
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
# Build Cache image
FROM fpco/stack-build-small:lts-19.2 as builder-cache
COPY stack.yaml /mnt
COPY *.cabal /mnt
WORKDIR /mnt
RUN rm -rf ~/.stack && \
stack config set system-ghc --global true && \
stack setup && \
stack install --ghc-options="-fPIC" --only-dependencies
# Build phase
FROM builder-cache as builder
# FROM ghcr.io/erebe/wstunnel:build-cache as builder
COPY . /mnt
RUN echo ' ld-options: -static' >> wstunnel.cabal ; \
stack install --ghc-options="-fPIC"
#RUN upx /root/.local/bin/wstunnel
# Final Image
FROM alpine:latest as runner
LABEL org.opencontainers.image.source https://github.com/erebe/server
COPY --from=builder /root/.local/bin/wstunnel /
RUN adduser -D abc && chmod +x /wstunnel
USER abc
WORKDIR /
CMD ["/wstunnel"]