-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (33 loc) · 1.29 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
FROM alpine:3.10
MAINTAINER [email protected]
# installation/environment setup
ARG TAG=dev
WORKDIR /app
ENV PATH="/root/.local/bin:/usr/local/bin:${PATH}"
ENV KIT_STD_PATH=/opt/kit/std
ENV KIT_TOOLCHAIN_PATH=/opt/kit/toolchains
RUN apk add bash cmake curl emscripten gcc ghc git make musl-dev openjdk11-jre py2-pip zlib-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
# haskell stack
RUN curl -sSL https://get.haskellstack.org/ | sh
# install Emscripten
# RUN git clone https://github.com/emscripten-core/emsdk.git /opt/emsdk && \
# cd /opt/emsdk && \
# ./emsdk install latest && \
# ./emsdk activate latest
# install Kit
RUN git clone https://github.com/kitlang/kit /opt/kit && \
cd /opt/kit && \
git checkout ${TAG} && \
stack install kitlang:kitc --system-ghc
# compile a test program to force Emscripten to generate system libraries;
# otherwise this could cause playground requests to time out while they're
# generated
RUN echo "function main() { puts('hi'); }" > /tmp/test.kit && \
kitc --build-dir /tmp/build --host emscripten --build none /tmp/test.kit -o /tmp/test.js
# set up the playground
ADD requirements.txt /app/
RUN pip install -r requirements.txt
ADD playground.py /app/
EXPOSE 5000
ARG PLAYGROUND_ARGS=
CMD python playground.py ${PLAYGROUND_ARGS}