Browse Source

update: upgrade gcc version and Nim's version and buffer size UP. (#3613)

momf 7 years ago
parent
commit
434088a891
2 changed files with 21 additions and 5 deletions
  1. 20 4
      frameworks/Nim/mofuw/mofuw.dockerfile
  2. 1 1
      frameworks/Nim/mofuw/techempower.nim

+ 20 - 4
frameworks/Nim/mofuw/mofuw.dockerfile

@@ -1,14 +1,30 @@
-FROM nimlang/nim:0.18.0
+FROM gcc:7
 
-RUN apt update -yqq
+RUN apt update -yqq &&                                                  \
+    mkdir -p /nim &&                                                    \
+    cd /nim &&                                                          \
+    git clone -b devel https://github.com/nim-lang/Nim.git nim-devel && \
+    cd nim-devel &&                                                     \
+    git clone --depth 1 https://github.com/nim-lang/csources.git &&     \
+    cd csources &&                                                      \
+    sh build.sh &&                                                      \
+    cd ../ &&                                                           \
+    bin/nim c koch &&                                                   \
+    ./koch boot -d:release &&                                           \
+    ./koch nimble &&                                                    \
+    ./koch tools
+
+ENV PATH=$PATH:/nim/nim-devel/bin:/root/.nimble/bin
 
 RUN git clone https://github.com/2vg/mofuw.git && \
     cd mofuw && \
     nimble update && \
     echo 'y' | nimble install
 
-COPY ./ ./
+WORKDIR /app
+
+COPY ./ /app
 
 RUN chmod a+wrx start-servers.sh
 
-CMD ./start-servers.sh
+CMD ./start-servers.sh

+ 1 - 1
frameworks/Nim/mofuw/techempower.nim

@@ -6,4 +6,4 @@ proc h(req: mofuwReq, res: mofuwRes) {.async.} =
   else:
     mofuwResp(HTTP404, "text/plain", "NOT FOUND")
 
-h.mofuwRun(port = 8080, bufSize = 512)
+h.mofuwRun(port = 8080, bufSize = 1024)