-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
71 lines (62 loc) · 1.81 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM fpco/stack-build-small:lts-19.10 AS builder
LABEL maintainer="Pat Brisbin <pbrisbin@gmail.com>"
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
libpq-dev \
locales \
netbase \
libpcre3-dev && \
locale-gen en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /src
WORKDIR /src
# Dependencies
COPY stack.yaml package.yaml /src/
RUN stack install --dependencies-only
# Main app
COPY src /src/src
# Executables
COPY web /src/web
COPY sync-marketplace /src/sync-marketplace
COPY seed-db /src/seed-db
# Web support
COPY templates /src/templates
COPY config /src/config
ARG REVISION=unknown
RUN echo $REVISION > /src/config/revision
RUN stack install --ghc-options -DDOCKERIZED
# Docker client
ENV DOCKER_ARCHIVE docker-17.03.1-ce.tgz
ENV DOCKER_SRC_URL https://get.docker.com/builds/Linux/x86_64/$DOCKER_ARCHIVE
RUN \
curl -fsSLO "$DOCKER_SRC_URL" && \
tar --strip-components=1 -xvzf "$DOCKER_ARCHIVE" -C /usr/local/bin
FROM ubuntu:18.04
LABEL maintainer="Pat Brisbin <pbrisbin@gmail.com>"
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
libpq-dev \
locales \
netbase && \
locale-gen en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app
WORKDIR /app
# Build stage files
COPY --from=builder /src/config /app/config
COPY --from=builder /root/.local/bin/restyled.io /app/restyled.io
COPY --from=builder /root/.local/bin/sync-marketplace /app/sync-marketplace
COPY --from=builder /root/.local/bin/seed-db /app/seed-db
COPY --from=builder /usr/local/bin/docker /usr/local/bin/docker
# Static
COPY static /app/static
RUN mkdir -p /app/static/tmp