Skip to content

Commit

Permalink
Fix/docker (#6)
Browse files Browse the repository at this point in the history
* refactor: cleanup Dockerfile

* refactor: fix json

* refactor: fix json

* refactor: fix Dockerfile

* refactor: fix Dockerfile
  • Loading branch information
amitksingh1490 committed Nov 21, 2023
1 parent 0cbebc0 commit 2ab19b8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tasks": {
"run tailcall": {
"name": "run tailcall server",
"command": "ls /workspaces/tailcall-sandbox/exercises/*.graphql | entr -r $HOME/.tailcall/bin/tailcall start $(ls /workspaces/tailcall-sandbox/exercises/*.graphql)",
"command": "ls /workspaces/tailcall-sandbox/exercises/*.graphql | entr -r tailcall start $(ls /workspaces/tailcall-sandbox/exercises/*.graphql)",
"runAtStart": true,
"preview": {
"port": 4000
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"label": "Tailcall Playground",
"onAutoForward": "openPreview"
}
}
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// "postCreateCommand": "npm i -g @tailcallhq/tailcall"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
69 changes: 41 additions & 28 deletions .tailcallrc.graphql
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
directive @server(
enableApolloTracing: Boolean
enableCacheControlHeader: Boolean
enableGraphiql: String
enableIntrospection: Boolean
enableQueryValidation: Boolean
enableResponseValidation: Boolean
apolloTracing: Boolean
cacheControlHeader: Boolean
graphiql: Boolean
introspection: Boolean
queryValidation: Boolean
responseValidation: Boolean
batchRequests: Boolean
globalResponseTimeout: Int
workers: Int
port: Int
vars: [KeyValue]
upstream: Upstream
responseHeaders: [KeyValue]
hostname: String
version: HttpVersion
cert: String
key: String
) on SCHEMA

enum HttpVersion {
HTTP1
HTTP2
}

directive @upstream(
allowedHeaders: [String]
connectTimeout: Int
keepAliveInterval: Int
keepAliveTimeout: Int
keepAliveWhileIdle: Boolean
poolIdleTimeout: Int
poolMaxIdlePerHost: Int
proxy: Proxy
tcpKeepAlive: Int
timeout: Int
userAgent: String
baseURL: String
httpCache: Boolean
batch: Batch
) on SCHEMA

directive @http(
path: String!
method: Method = GET
query: [KeyValue]
body: String
baseURL: String
headers: [KeyValue]
groupBy: [String!]
) on FIELD_DEFINITION
directive @inline(path: [String]!) on FIELD_DEFINITION
directive @addField(name: String, path: [String]!) on OBJECT
directive @modify(omit: Boolean, name: String) on FIELD_DEFINITION
directive @groupBy(path: [String]!, key: String!) on FIELD_DEFINITION
directive @const(data: Json) on FIELD_DEFINITION
directive @groupBy(path: [String!]) on FIELD_DEFINITION
directive @const(data: JSON) on FIELD_DEFINITION

enum Method {
GET
Expand All @@ -37,23 +67,6 @@ input Proxy {
url: String
}

input Upstream {
allowedHeaders: [String]
connect_timeout: Int
keep_alive_interval: Int
keep_alive_timeout: Int
keep_alive_while_idle: Boolean
pool_idle_timeout: Int
pool_max_idle_per_host: Int
proxy: Proxy
tcp_keep_alive: Int
timeout: Int
user_agent: String
base_url: String
enable_http_cache: Boolean
batch: Batch
}

input KeyValue {
key: String!
value: String!
Expand All @@ -65,4 +78,4 @@ input Batch {
headers: [String]
}

scalar Json
scalar JSON
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM ubuntu:latest
# Use an official Node.js runtime as a parent image
FROM node:latest

# Install utilities
RUN apt-get update && apt-get install -y curl jq entr

# Set the working directory
WORKDIR /exercises

# Copy the current directory contents into the container at /exercises
COPY ./exercises/. /exercises

RUN npm install -g @tailcallhq/tailcall

# Make port 4000 available to the world outside this container
EXPOSE 4000
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/main/install.sh | bash -s

0 comments on commit 2ab19b8

Please sign in to comment.