aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 8339f2dddcb44d27c5dbbf0e394ac5a155400347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM fossa/haskell-static-alpine:ghc-8.10.4 AS build

ARG SLAM_GIT_REPO=https://github.com/jantuomi/slam-interpreter.git
ARG SLAM_GIT_CHECKOUT=main

RUN cabal update
RUN git clone $SLAM_GIT_REPO /slam
WORKDIR /slam
RUN git checkout $SLAM_GIT_CHECKOUT
RUN cabal build --enable-executable-static \
    && mv $(cabal list-bin slam-interpreter) ./interpreter \
    && strip ./interpreter

FROM node:16-alpine AS serve

ENV NODE_ENV production
ENV PORT 8080

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only-prod
COPY --from=build /slam/interpreter ./
COPY src ./src
CMD ["npm", "start"]