Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Last active September 4, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzo/aec9a928d66f5839533f0326de138f39 to your computer and use it in GitHub Desktop.
Save lorenzo/aec9a928d66f5839533f0326de138f39 to your computer and use it in GitHub Desktop.
FROM fpco/stack-build:lts-12.9 AS stack-build
RUN stack setup --resolver=lts-12.9
COPY ./stack.yaml ./package.yaml ./
RUN stack build --only-dependencies
COPY . .
RUN stack install
FROM ubuntu:16.04 as base
RUN apt-get update \
&& apt-get install --no-install-recommends libpq-dev libcurl4-openssl-dev wget netbase unzip ca-certificates -y \
&& rm -rf /var/lib/apt/lists/*
#
# Install 'pid1' init daemon
#
RUN wget -O- "https://github.com/fpco/pid1/releases/download/pid1%2F0.1.0.1/pid1-0.1.0.1-linux-x86_64.tar.gz" | tar xzf - -C /usr/local && \
chown root:root /usr/local/sbin && \
chown root:root /usr/local/sbin/pid1
COPY --from=stack-build /root/.local/bin/my-program /bin
ENTRYPOINT ["/usr/local/sbin/pid1"]
CMD ["/bin/my-program"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment