This commit is contained in:
Cadey Ratio 2019-12-08 20:06:45 +00:00
parent 1c5f163108
commit 4edfaf3dfe
6 changed files with 76 additions and 1 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
wasmcloud.db

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM xena/go:1.13.5 AS build
WORKDIR /wasmcloud
COPY . .
ENV GOPROXY https://cache.greedo.xeserv.us
RUN GOBIN=/wasmcloud/bin go install -tags=postgres ./cmd/...
FROM xena/alpine
COPY --from=build /wasmcloud/bin/ /usr/local/bin
CMD wasmcloudd
WORKDIR /wasmcloud
COPY tmpl/ /wasmcloud/tmpl/
COPY static/ /wasmcloud/static/
COPY doc/ /wasmcloud/doc/

View File

@ -9,7 +9,6 @@ import (
"github.com/facebookgo/flagenv"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3"
nats "github.com/nats-io/nats.go"
)

View File

@ -0,0 +1,8 @@
// +build postgres
package main
import (
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/lib/pq"
)

8
cmd/wasmcloudd/sqlite.go Normal file
View File

@ -0,0 +1,8 @@
// +build !postgres
package main
import (
_ "github.com/jinzhu/gorm/dialects/sqlite"
_ "github.com/mattn/go-sqlite3"
)

45
docker-compose.yml Normal file
View File

@ -0,0 +1,45 @@
version: '3.7'
services:
ipfs:
image: "ipfs/go-ipfs:latest"
environment:
- IPFS_PROFILE=server
volumes:
- ipfs:/data/ipfs
worker:
deploy:
replicas: 3
restart: always
image: xena/wasmcloud
environment:
- IPFS_HOST=ipfs:5001
- NATS_URL=nats://nats:4222
- WORKER_COUNT=16
command: /usr/local/bin/wasmcloud-executor
web:
restart: always
image: xena/wasmcloud
ports:
- "3002:3002"
environment:
- DATABASE_KIND=postgres
- "DATABASE_URL=host=postgres port=5432 user=azurediamond dbname=wasmcloud password=hunter2 sslmode=disable"
- NATS_URL=nats://nats:4222
- IPFS_HOST=ipfs:5001
command: /usr/local/bin/wasmcloudd
postgres:
image: "postgres:alpine"
environment:
- POSTGRES_PASSWORD=hunter2
- POSTGRES_USER=azurediamond
- POSTGRES_DB=wasmcloud
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
nats:
image: "nats:latest"
volumes:
ipfs:
postgresql:
postgresql_data: