Ok, works now.

This commit is contained in:
Travis Reeder
2015-10-12 23:27:45 -07:00
parent bb95b73c23
commit bfe2d91217
4 changed files with 29 additions and 8 deletions

8
Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM treeder/go-dind
RUN mkdir /app
ADD app /app/gateway
#ADD /home/treeder/.iron.json /app/iron.json
WORKDIR /app
ENTRYPOINT rc default && sleep 1 && ./gateway && sleep 1

View File

@@ -37,6 +37,7 @@ curl -i -X GET http://localhost:8080/sinatra?app=myapp
```
## Building/Testing
```sh
@@ -46,6 +47,17 @@ docker run --rm -it --privileged --net=host -v "$PWD":/app -v $HOME:/root:ro -w
Then run the commands above to use it.
Build image:
```sh
docker build -t iron/gateway:latest .
```
Test it, the iron token and project id are for cache.
```sh
docker run --rm -it --privileged --net=host -p 8080:8080 -e "IRON_TOKEN=GP8cqlKSrcpmqeR8x9WKD4qSAss" -e "IRON_PROJECT_ID=4fd2729368a0197d1102056b" -e "IRON_API_DEBUG=true" iron/gateway
```
# Previous version:

View File

@@ -84,14 +84,14 @@ func main() {
// ironAuth = apiauth.New(config.Iron.AuthHost)
cacheConfigMap := map[string]interface{}{
"token": config.Cache.Token,
"project_id": config.Cache.ProjectId,
}
if config.Cache.Host != "" {
cacheConfigMap["host"] = config.Cache.Host
}
icache.Settings.UseConfigMap(cacheConfigMap)
// cacheConfigMap := map[string]interface{}{
// "token": config.Cache.Token,
// "project_id": config.Cache.ProjectId,
// }
// if config.Cache.Host != "" {
// cacheConfigMap["host"] = config.Cache.Host
// }
// icache.Settings.UseConfigMap(cacheConfigMap)
r := mux.NewRouter()

View File

@@ -26,6 +26,7 @@ var runningImages map[string]*RunningApp
func init() {
runningImages = make(map[string]*RunningApp)
fmt.Println("ENV:", os.Environ())
}
func Run(w http.ResponseWriter, req *http.Request) {