Browse Source

[ci lang-only Crystal] Crystal/* Remove TE dependencies (#3531)

Michael Hixson 7 years ago
parent
commit
4cf8c958a8

+ 6 - 3
frameworks/Crystal/amber/amber.dockerfile

@@ -1,14 +1,17 @@
-FROM techempower/crystal-lang:0.1
+FROM crystallang/crystal:0.24.1
 
-ADD ./ /amber
 WORKDIR /amber
+COPY config config
+COPY src src
+COPY run.sh run.sh
+COPY shard.lock shard.lock
+COPY shard.yml shard.yml
 
 ENV GC_MARKERS 1
 ENV AMBER_ENV production
 ENV DATABASE_URL postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world
 
 RUN apt-get install -y libyaml-dev
-
 RUN shards build amber --release --no-debug
 
 CMD bash run.sh

+ 6 - 2
frameworks/Crystal/crystal/crystal-radix.dockerfile

@@ -1,7 +1,11 @@
-FROM techempower/crystal-lang:0.1
+FROM crystallang/crystal:0.24.1
 
-ADD ./ /crystal
 WORKDIR /crystal
+COPY views views
+COPY run-radix.sh run-radix.sh
+COPY server_radix.cr server_radix.cr
+COPY shard.lock shard.lock
+COPY shard.yml shard.yml
 
 ENV GC_MARKERS 1
 

+ 6 - 2
frameworks/Crystal/crystal/crystal.dockerfile

@@ -1,7 +1,11 @@
-FROM techempower/crystal-lang:0.1
+FROM crystallang/crystal:0.24.1
 
-ADD ./ /crystal
 WORKDIR /crystal
+COPY views views
+COPY run.sh run.sh
+COPY server.cr server.cr
+COPY shard.lock shard.lock
+COPY shard.yml shard.yml
 
 ENV GC_MARKERS 1
 

+ 1 - 1
frameworks/Crystal/crystal/server.cr

@@ -3,7 +3,7 @@ require "json"
 require "pg"
 require "ecr"
 
-APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@#{ENV["DBHOST"]? || "127.0.0.1"}:5432/hello_world?initial_pool_size=256&max_pool_size=256&max_idle_pool_size=256")
+APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world?initial_pool_size=256&max_pool_size=256&max_idle_pool_size=256")
 ID_MAXIMUM = 10_000
 
 server = HTTP::Server.new("0.0.0.0", 8080) do |context|

+ 1 - 1
frameworks/Crystal/crystal/server_radix.cr

@@ -89,7 +89,7 @@ tree.add "/queries", queries_handler
 tree.add "/fortunes", fortunes_handler
 tree.add "/updates", updates_handler
 
-APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@#{ENV["DBHOST"]? || "127.0.0.1"}:5432/hello_world")
+APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world")
 ID_MAXIMUM = 10_000
 
 server = HTTP::Server.new("0.0.0.0", 8080) do |context|

+ 6 - 2
frameworks/Crystal/kemal/kemal.dockerfile

@@ -1,7 +1,11 @@
-FROM techempower/crystal-lang:0.1
+FROM crystallang/crystal:0.24.1
 
-ADD ./ /kemal
 WORKDIR /kemal
+COPY views views
+COPY run.sh run.sh
+COPY server-postgres.cr server-postgres.cr
+COPY shard.lock shard.lock
+COPY shard.yml shard.yml
 
 ENV GC_MARKERS 1
 ENV KEMAL_ENV production

+ 1 - 1
frameworks/Crystal/kemal/server-postgres.cr

@@ -4,7 +4,7 @@ require "pg"
 # Compose Objects (like Hash) to have a to_json method
 require "json/to_json"
 
-APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@#{ENV["DBHOST"]? || "127.0.0.1"}:5432/hello_world")
+APPDB = DB.open("postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world")
 
 class CONTENT
   UTF8  = "; charset=UTF-8"