Update Docker stuff

Remove old run scripts
Add environment parsing
Add Dockerfiles
Add docker-compose for easy building

Signed-off-by: feffe <feffe@feffe.dev>
This commit is contained in:
feffe 2019-10-04 12:41:46 +02:00
parent 3dabf4d4ed
commit 154e99b12a
No known key found for this signature in database
GPG key ID: 5361564C191A62DF
40 changed files with 338 additions and 307 deletions

View file

@ -24,6 +24,8 @@ import (
"strings"
"time"
"github.com/matrix-org/dendrite/common/basecomponent"
log "github.com/sirupsen/logrus"
)
@ -48,13 +50,13 @@ Arguments:
`
var (
syncServerURL = flag.String("sync-api-server-url", "", "The base URL of the listening 'dendrite-sync-api-server' process. E.g. 'http://localhost:4200'")
clientAPIURL = flag.String("client-api-server-url", "", "The base URL of the listening 'dendrite-client-api-server' process. E.g. 'http://localhost:4321'")
mediaAPIURL = flag.String("media-api-server-url", "", "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'")
publicRoomsAPIURL = flag.String("public-rooms-api-server-url", "", "The base URL of the listening 'dendrite-public-rooms-api-server' process. E.g. 'http://localhost:7775'")
bindAddress = flag.String("bind-address", ":8008", "The listening port for the proxy.")
certFile = flag.String("tls-cert", "", "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", "", "The PEM private key to use for TLS")
syncServerURL = flag.String("sync-api-server-url", basecomponent.EnvParse("DENDRITE_SYNC_API_SERVER_URL", ""), "The base URL of the listening 'dendrite-sync-api-server' process. E.g. 'http://localhost:4200'")
clientAPIURL = flag.String("client-api-server-url", basecomponent.EnvParse("DENDRITE_CLIENT_API_URL", ""), "The base URL of the listening 'dendrite-client-api-server' process. E.g. 'http://localhost:4321'")
mediaAPIURL = flag.String("media-api-server-url", basecomponent.EnvParse("DENDRITE_MEDIA_API_URL", ""), "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'")
publicRoomsAPIURL = flag.String("public-rooms-api-server-url", basecomponent.EnvParse("DENDRITE_PUBLIC_ROOMS_API_URL", ""), "The base URL of the listening 'dendrite-public-rooms-api-server' process. E.g. 'http://localhost:7775'")
bindAddress = flag.String("bind-address", basecomponent.EnvParse("DENDRITE_CLIENT_API_PROXY_ADDRESS", ":8008"), "The listening port for the proxy.")
certFile = flag.String("tls-cert", basecomponent.EnvParse("DENDRITE_TLS_CERT_FILE", ""), "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", basecomponent.EnvParse("DENDRITE_TLS_KEY_FILE", ""), "The PEM private key to use for TLS")
)
func makeProxy(targetURL string) (*httputil.ReverseProxy, error) {

View file

@ -22,6 +22,7 @@ import (
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
"github.com/matrix-org/dendrite/common/basecomponent"
"github.com/matrix-org/gomatrixserverlib"
)
@ -34,11 +35,11 @@ Arguments:
`
var (
database = flag.String("database", "", "The location of the account database.")
username = flag.String("username", "", "The user ID localpart to register e.g 'alice' in '@alice:localhost'.")
password = flag.String("password", "", "Optional. The password to register with. If not specified, this account will be password-less.")
serverNameStr = flag.String("servername", "localhost", "The Matrix server domain which will form the domain part of the user ID.")
accessToken = flag.String("token", "", "Optional. The desired access_token to have. If not specified, a random access_token will be made.")
database = flag.String("database", basecomponent.EnvParse("DENDRITE_CREATE_ACCOUNT_DATABASE", ""), "The location of the account database.")
username = flag.String("username", basecomponent.EnvParse("DENDRITE_CREATE_ACCOUNT_USERNAME", ""), "The user ID localpart to register e.g 'alice' in '@alice:localhost'.")
password = flag.String("password", basecomponent.EnvParse("DENDRITE_CREATE_ACCOUNT_PASSWORD", ""), "Optional. The password to register with. If not specified, this account will be password-less.")
serverNameStr = flag.String("servername", basecomponent.EnvParse("DENDRITE_CREATE_ACCOUNT_SERVERNAME", "localhost"), "The Matrix server domain which will form the domain part of the user ID.")
accessToken = flag.String("token", basecomponent.EnvParse("DENDRITE_CREATE_ACCOUNT_ACCESS_TOKEN", ""), "Optional. The desired access_token to have. If not specified, a random access_token will be made.")
)
func main() {

View file

@ -25,6 +25,7 @@ import (
"strings"
"time"
"github.com/matrix-org/dendrite/common/basecomponent"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"golang.org/x/crypto/ed25519"
@ -40,13 +41,13 @@ Arguments:
`
var (
serverName = flag.String("server-name", "localhost", "The name of the matrix server to generate events for")
keyID = flag.String("key-id", "ed25519:auto", "The ID of the key used to sign the events")
privateKeyString = flag.String("private-key", defaultKey, "Base64 encoded private key to sign events with")
roomID = flag.String("room-id", "!roomid:$SERVER_NAME", "The room ID to generate events in")
userID = flag.String("user-id", "@userid:$SERVER_NAME", "The user ID to use as the event sender")
serverName = flag.String("server-name", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_SERVERNAME", "localhost"), "The name of the matrix server to generate events for")
keyID = flag.String("key-id", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_KEYID", "ed25519:auto"), "The ID of the key used to sign the events")
privateKeyString = flag.String("private-key", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_PRIVATE_KEY", defaultKey), "Base64 encoded private key to sign events with")
roomID = flag.String("room-id", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_ROOMID", "!roomid:$SERVER_NAME"), "The room ID to generate events in")
userID = flag.String("user-id", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_USERID", "@userid:$SERVER_NAME"), "The user ID to use as the event sender")
messageCount = flag.Int("message-count", 10, "The number of m.room.messsage events to generate")
format = flag.String("Format", "InputRoomEvent", "The output format to use for the messages: InputRoomEvent or Event")
format = flag.String("Format", basecomponent.EnvParse("DENDRITE_CREATE_ROOM_EVENTS_FORMAT", "InputRoomEvent"), "The output format to use for the messages: InputRoomEvent or Event")
)
// By default we use a private key of 0.

View file

@ -38,10 +38,10 @@ import (
)
var (
httpBindAddr = flag.String("http-bind-address", ":8008", "The HTTP listening port for the server")
httpsBindAddr = flag.String("https-bind-address", ":8448", "The HTTPS listening port for the server")
certFile = flag.String("tls-cert", "", "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", "", "The PEM private key to use for TLS")
httpBindAddr = flag.String("http-bind-address", basecomponent.EnvParse("DENDRITE_MONOLITH_HTTP_BIND_ADDRESS", ":8008"), "The HTTP listening port for the server")
httpsBindAddr = flag.String("https-bind-address", basecomponent.EnvParse("DENDRITE_MONOLITH_HTTPS_BIND_ADDRESS", ":8448"), "The HTTPS listening port for the server")
certFile = flag.String("tls-cert", basecomponent.EnvParse("DENDRITE_TLS_CERT_FILE", ""), "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", basecomponent.EnvParse("DENDRITE_TLS_KEY_FILE", ""), "The PEM private key to use for TLS")
)
func main() {

View file

@ -24,6 +24,8 @@ import (
"strings"
"time"
"github.com/matrix-org/dendrite/common/basecomponent"
log "github.com/sirupsen/logrus"
)
@ -48,11 +50,11 @@ Arguments:
`
var (
federationAPIURL = flag.String("federation-api-url", "", "The base URL of the listening 'dendrite-federation-api-server' process. E.g. 'http://localhost:4200'")
mediaAPIURL = flag.String("media-api-server-url", "", "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'")
bindAddress = flag.String("bind-address", ":8448", "The listening port for the proxy.")
certFile = flag.String("tls-cert", "server.crt", "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", "server.key", "The PEM private key to use for TLS")
federationAPIURL = flag.String("federation-api-url", basecomponent.EnvParse("DENDRITE_FEDERATION_API_URL", ""), "The base URL of the listening 'dendrite-federation-api-server' process. E.g. 'http://localhost:4200'")
mediaAPIURL = flag.String("media-api-server-url", basecomponent.EnvParse("DENDRITE_MEDIA_API_URL", ""), "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'")
bindAddress = flag.String("bind-address", basecomponent.EnvParse("DENDRITE_FEDERATION_PROXY_ADDRESS", ":8448"), "The listening port for the proxy.")
certFile = flag.String("tls-cert", basecomponent.EnvParse("DENDRITE_TLS_CERT_FILE", "server.crt"), "The PEM formatted X509 certificate to use for TLS")
keyFile = flag.String("tls-key", basecomponent.EnvParse("DENDRITE_TLS_KEY_FILE", "server.key"), "The PEM private key to use for TLS")
)
func makeProxy(targetURL string) (*httputil.ReverseProxy, error) {

View file

@ -20,6 +20,8 @@ import (
"log"
"os"
"github.com/matrix-org/dendrite/common/basecomponent"
"github.com/matrix-org/dendrite/common/test"
)
@ -32,9 +34,9 @@ Arguments:
`
var (
tlsCertFile = flag.String("tls-cert", "", "An X509 certificate file to generate for use for TLS")
tlsKeyFile = flag.String("tls-key", "", "An RSA private key file to generate for use for TLS")
privateKeyFile = flag.String("private-key", "", "An Ed25519 private key to generate for use for object signing")
tlsCertFile = flag.String("tls-cert", basecomponent.EnvParse("DENDRITE_GENKEYS_TLS_CERT_OUT", ""), "An X509 certificate file to generate for use for TLS")
tlsKeyFile = flag.String("tls-key", basecomponent.EnvParse("DENDRITE_GENKEYS_TLS_KEY_OUT", ""), "An RSA private key file to generate for use for TLS")
privateKeyFile = flag.String("private-key", basecomponent.EnvParse("DENDRITE_GENKEYS_PEM_OUT", ""), "An Ed25519 private key to generate for use for object signing")
)
func main() {

View file

@ -21,6 +21,8 @@ import (
"os"
"strings"
"github.com/matrix-org/dendrite/common/basecomponent"
sarama "gopkg.in/Shopify/sarama.v1"
)
@ -34,7 +36,7 @@ Arguments:
var (
brokerList = flag.String("brokers", os.Getenv("KAFKA_PEERS"), "The comma separated list of brokers in the Kafka cluster. You can also set the KAFKA_PEERS environment variable")
topic = flag.String("topic", "", "REQUIRED: the topic to produce to")
topic = flag.String("topic", basecomponent.EnvParse("DENDRITE_KAFKAPROD_TOPIC", ""), "REQUIRED: the topic to produce to")
partition = flag.Int("partition", 0, "The partition to produce to. All the messages will be written to this partition.")
)

View file

@ -16,13 +16,14 @@ package basecomponent
import (
"flag"
"os"
"github.com/matrix-org/dendrite/common/config"
"github.com/sirupsen/logrus"
)
var configPath = flag.String("config", "dendrite.yaml", "The path to the config file. For more information, see the config file in this repository.")
var configPath = flag.String("config", EnvParse("DENDRITE_CONFIG_FILE", "dendrite.yaml"), "The path to the config file. For more information, see the config file in this repository.")
// ParseFlags parses the commandline flags and uses them to create a config.
// If running as a monolith use `ParseMonolithFlags` instead.
@ -59,3 +60,12 @@ func ParseMonolithFlags() *config.Dendrite {
return cfg
}
// EnvParse returns the value of the environmentvariable if it exists, otherwise `def`.
func EnvParse(env string, def string) string {
cnf, exists := os.LookupEnv(env)
if !exists {
cnf = def
}
return cnf
}

View file

@ -1,8 +1,4 @@
<<<<<<< HEAD
FROM docker.io/golang:1.13.7-alpine3.11
=======
FROM docker.io/golang:1.13.6-alpine
>>>>>>> master
RUN mkdir /build

View file

@ -0,0 +1,120 @@
###############################
# Used for building images
version: "3.4"
services:
dendrite-build:
image: dendrite-build
build:
context: ..
target: build
dockerfile: ./docker/dockerfiles/build.Dockerfile
monolith:
image: monolith:latest
build:
context: ..
target: monolith
dockerfile: ./docker/dockerfiles/monolith.Dockerfile
client-api-proxy:
image: client-api-proxy:latest
build:
context: ..
target: client-api-proxy
dockerfile: ./docker/dockerfiles/client-api-proxy.Dockerfile
client-api:
image: client-api:latest
build:
context: ..
target: client-api
dockerfile: ./docker/dockerfiles/client-api.Dockerfile
media-api:
image: media-api:latest
build:
context: ..
target: media-api
dockerfile: ./docker/dockerfiles/media-api.Dockerfile
public-rooms-api:
image: public-rooms-api:latest
build:
context: ..
target: public-rooms-api
dockerfile: ./docker/dockerfiles/public-rooms-api.Dockerfile
sync-api:
image: sync-api:latest
build:
context: ..
target: sync-api
dockerfile: ./docker/dockerfiles/sync-api.Dockerfile
room-server:
image: room-server:latest
build:
context: ..
target: room-server
dockerfile: ./docker/dockerfiles/room-server.Dockerfile
typing-server:
image: typing-server:latest
build:
context: ..
target: typing-server
dockerfile: ./docker/dockerfiles/typing-server.Dockerfile
federation-api-proxy:
image: federation-api-proxy:latest
build:
context: ..
target: federation-api-proxy
dockerfile: ./docker/dockerfiles/federation-api-proxy.Dockerfile
federation-api:
image: federation-api:latest
build:
context: ..
target: federation-api
dockerfile: ./docker/dockerfiles/federation-api.Dockerfile
federation-sender:
image: federation-sender:latest
build:
context: ..
target: federation-sender
dockerfile: ./docker/dockerfiles/federation-sender.Dockerfile
appservice-server:
image: appservice-server:latest
build:
context: ..
target: appservice-server
dockerfile: ./docker/dockerfiles/appservice-server.Dockerfile
generate-keys-tool:
image: generate-keys-tool:latest
build:
context: ..
target: generate-keys-tool
dockerfile: ./docker/dockerfiles/generate-keys-tool.Dockerfile
create-account-tool:
image: create-account-tool:latest
build:
context: ..
target: create-account-tool
dockerfile: ./docker/dockerfiles/create-account-tool.Dockerfile
create-room-events-tool:
image: create-room-events-tool:latest
build:
context: ..
target: create-room-events-tool
dockerfile: ./docker/dockerfiles/create-room-events-tool.Dockerfile
kafka-producer:
image: kafka-producer:latest
build:
context: ..
target: kafka-producer
dockerfile: ./docker/dockerfiles/kafka-producer.Dockerfile

View file

@ -1,18 +0,0 @@
#!/bin/bash
./build.sh
# Generate the keys if they don't already exist.
if [ ! -f server.key ] || [ ! -f server.crt ] || [ ! -f matrix_key.pem ]; then
echo "Generating keys ..."
rm -f server.key server.crt matrix_key.pem
test -f server.key || openssl req -x509 -newkey rsa:4096 \
-keyout server.key \
-out server.crt \
-days 3650 -nodes \
-subj /CN=localhost
test -f matrix_key.pem || /build/bin/generate-keys -private-key matrix_key.pem
fi

View file

@ -1,192 +0,0 @@
version: "3.4"
services:
riot:
image: vectorim/riot-web
networks:
- internal
ports:
- "8500:80"
monolith:
container_name: dendrite_monolith
hostname: monolith
entrypoint: ["bash", "./docker/services/monolith.sh", "--config", "/etc/dendrite/dendrite.yaml"]
build: ./
volumes:
- ..:/build
- ./build/bin:/build/bin
- ../cfg:/etc/dendrite
networks:
- internal
depends_on:
- postgres
ports:
- "8008:8008"
- "8448:8448"
client_api_proxy:
container_name: dendrite_client_api_proxy
hostname: client_api_proxy
entrypoint: ["bash", "./docker/services/client-api-proxy.sh"]
build: ./
volumes:
- ..:/build
networks:
- internal
depends_on:
- postgres
- sync_api
- client_api
- media_api
- public_rooms_api
ports:
- "8008:8008"
client_api:
container_name: dendrite_client_api
hostname: client_api
entrypoint: ["bash", "./docker/services/client-api.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
- room_server
networks:
- internal
media_api:
container_name: dendrite_media_api
hostname: media_api
entrypoint: ["bash", "./docker/services/media-api.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
public_rooms_api:
container_name: dendrite_public_rooms_api
hostname: public_rooms_api
entrypoint: ["bash", "./docker/services/public-rooms-api.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
sync_api:
container_name: dendrite_sync_api
hostname: sync_api
entrypoint: ["bash", "./docker/services/sync-api.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
room_server:
container_name: dendrite_room_server
hostname: room_server
entrypoint: ["bash", "./docker/services/room-server.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
typing_server:
container_name: dendrite_typing_server
hostname: typing_server
entrypoint: ["bash", "./docker/services/typing-server.sh"]
build: ./
volumes:
- ..:/build
networks:
- internal
federation_api_proxy:
container_name: dendrite_federation_api_proxy
hostname: federation_api_proxy
entrypoint: ["bash", "./docker/services/federation-api-proxy.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
- federation_api
- federation_sender
- media_api
networks:
- internal
ports:
- "8448:8448"
federation_api:
container_name: dendrite_federation_api
hostname: federation_api
entrypoint: ["bash", "./docker/services/federation-api.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
federation_sender:
container_name: dendrite_federation_sender
hostname: federation_sender
entrypoint: ["bash", "./docker/services/federation-sender.sh"]
build: ./
volumes:
- ..:/build
depends_on:
- postgres
networks:
- internal
postgres:
container_name: dendrite_postgres
hostname: postgres
image: postgres:9.5
restart: always
volumes:
- ./postgres/create_db.sh:/docker-entrypoint-initdb.d/20-create_db.sh
environment:
POSTGRES_PASSWORD: itsasecret
POSTGRES_USER: dendrite
networks:
- internal
zookeeper:
container_name: dendrite_zk
hostname: zookeeper
image: zookeeper
networks:
- internal
kafka:
container_name: dendrite_kafka
hostname: kafka
image: wurstmeister/kafka
environment:
KAFKA_ADVERTISED_HOST_NAME: "kafka"
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
depends_on:
- zookeeper
networks:
- internal
networks:
internal:
attachable: true

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
#######################
## Appservice Server ##
#######################
FROM scratch AS appservice-server
EXPOSE 7777
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-appservice-server /bin/appservice-server
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/appservice-server"]

View file

@ -0,0 +1,8 @@
###########
## Build ##
###########
FROM golang:1.13-alpine AS build
RUN apk --update --no-cache add openssl bash git ca-certificates
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOBIN=$PWD/bin go install -v ./cmd/...

View file

@ -0,0 +1,9 @@
FROM dendrite-build AS build
######################
## Client API Proxy ##
######################
FROM scratch AS client-api-proxy
EXPOSE 8008
ENV CLIENT_API_SERVER_URL="http://client-api:7771" SYNC_API_SERVER_URL="http://sync-api:7773" MEDIA_API_SERVER_URL="http://media-api:7774" PUBLIC_ROOMS_API_SERVER_URL="http://public-rooms-api:7775"
COPY --from=build /build/bin/client-api-proxy /bin/client-api-proxy
ENTRYPOINT ["/bin/client-api-proxy", "--bind-address=`:8008`"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
################
## Client API ##
################
FROM scratch AS client-api
EXPOSE 7771
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-client-api-server /bin/client-api
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/client-api"]

View file

@ -0,0 +1,7 @@
FROM dendrite-build AS build
#########################
## Create Account Tool ##
#########################
FROM scratch AS create-account-tool
COPY --from=build /build/bin/create-account /bin/create-account
ENTRYPOINT ["/bin/create-account"]

View file

@ -0,0 +1,7 @@
FROM dendrite-build AS build
#############################
## Create Room Events Tool ##
#############################
FROM scratch AS create-room-events-tool
COPY --from=build /build/bin/create-room-events /bin/create-room-events
ENTRYPOINT ["/bin/create-room-events"]

View file

@ -0,0 +1,9 @@
FROM dendrite-build AS build
##########################
## Federation API Proxy ##
##########################
FROM scratch AS federation-api-proxy
EXPOSE 8008
ENV FEDERATION_API_SERVER_URL="http://federation-api:7772" MEDIA_API_SERVER_URL="http://media-api:7774"
COPY --from=build /build/bin/federation-api-proxy /bin/federation-api-proxy
ENTRYPOINT ["/bin/federation-api-proxy", "--bind-address=`:8008`"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
####################
## Federation API ##
####################
FROM scratch AS federation-api
EXPOSE 7772
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-federation-api-server /bin/federation-api
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/federation-api"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
#######################
## Federation Sender ##
#######################
FROM scratch AS federation-sender
EXPOSE 7776
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-federation-sender-server /bin/federation-sender
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/federation-sender"]

View file

@ -0,0 +1,7 @@
FROM dendrite-build AS build
########################
## Generate Keys Tool ##
########################
FROM scratch AS generate-keys-tool
COPY --from=build /build/bin/generate-keys /bin/generate-keys
ENTRYPOINT ["/bin/generate-keys"]

View file

@ -0,0 +1,7 @@
FROM dendrite-build AS build
####################
## Kafka Producer ##
####################
FROM scratch AS kafka-producer
COPY --from=build /build/bin/kafka-producer /bin/kafka-producer
ENTRYPOINT ["/bin/kafka-producer"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
###############
## Media API ##
###############
FROM scratch AS media-api
EXPOSE 7774
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-media-api-server /bin/media-api
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/media-api"]

View file

@ -0,0 +1,13 @@
FROM dendrite-build AS build
##############
## Monolith ##
##############
FROM scratch AS monolith
EXPOSE 8008 8448
ENV DENDRITE_CONFIG_FILE="dendrite.yaml" TLS_CERT_FILE="server.crt" TLS_KEY_FILE="server.key"
WORKDIR /dendrite
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /build/bin/dendrite-monolith-server /bin/monolith
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/monolith"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
######################
## Public Rooms API ##
######################
FROM scratch AS public-rooms-api
EXPOSE 7775
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-public-rooms-api-server /bin/public-rooms-api
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/public-rooms-api"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
#################
## Room Server ##
#################
FROM scratch AS room-server
EXPOSE 7770
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-room-server /bin/room-server
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/room-server"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
##############
## Sync API ##
##############
FROM scratch AS sync-api
EXPOSE 7773
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-sync-api-server /bin/sync-api
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/sync-api"]

View file

@ -0,0 +1,11 @@
FROM dendrite-build AS build
###################
## Typing Server ##
###################
FROM scratch AS typing-server
EXPOSE 7778
ENV DENDRITE_CONFIG_FILE="dendrite.yaml"
WORKDIR /dendrite
COPY --from=build /build/bin/dendrite-typing-server /bin/typing-server
COPY --from=build /build/docker/dendrite-docker.yml ./dendrite.yaml
ENTRYPOINT ["/bin/typing-server"]

View file

@ -1,9 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/client-api-proxy --bind-address ":8008" \
--client-api-server-url "http://client_api:7771" \
--sync-api-server-url "http://sync_api:7773" \
--media-api-server-url "http://media_api:7774" \
--public-rooms-api-server-url "http://public_rooms_api:7775" \

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-client-api-server --config=dendrite.yaml

View file

@ -1,7 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/federation-api-proxy --bind-address ":8448" \
--federation-api-url "http://federation_api_server:7772" \
--media-api-server-url "http://media_api:7774" \

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-federation-api-server --config dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-federation-sender-server --config dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-media-api-server --config dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-monolith-server --tls-cert=server.crt --tls-key=server.key $@

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-public-rooms-api-server --config dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-room-server --config=dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-sync-api-server --config=dendrite.yaml

View file

@ -1,5 +0,0 @@
#!/bin/bash
bash ./docker/build.sh
./bin/dendrite-typing-server --config=dendrite.yaml