docker
This commit is contained in:
parent
1c5f163108
commit
4edfaf3dfe
|
@ -0,0 +1 @@
|
|||
wasmcloud.db
|
|
@ -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/
|
||||
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// +build postgres
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
// +build !postgres
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
|
@ -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:
|
Loading…
Reference in New Issue