mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Relocate Dockerfiles
This commit is contained in:
parent
9a56cf8439
commit
3b47a7a749
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Vector Creations Ltd
|
||||
fBIN// Copyright 2017 Vector Creations Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
14
docker/microservices/Dockerfile
Normal file
14
docker/microservices/Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
FROM golang:1.12.9
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the source from the current directory to the Working Directory inside the container
|
||||
COPY . .
|
||||
|
||||
# Statically link binaries
|
||||
ENV CGO_ENABLED=0
|
||||
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
|
||||
RUN go mod download
|
||||
|
||||
# Build the Go app
|
||||
RUN ./build.sh
|
||||
13
docker/microservices/client-api-proxy.Dockerfile
Normal file
13
docker/microservices/client-api-proxy.Dockerfile
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/client-api-proxy /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /client-api-proxy \
|
||||
-bind-address $CLIENT_BIND_ADDRESS \
|
||||
-client-api-server-url $CLIENT_API_SERVER_URL \
|
||||
-sync-api-server-url $SYNC_API_SERVER_URL \
|
||||
-media-api-server-url $MEDIA_API_SERVER_URL \
|
||||
-public-rooms-api-server-url $PUBLIC_ROOMS_API_SERVER_URL
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-appservice-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-appservice-server \
|
||||
--config $CONFIG
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-client-api-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-client-api-server \
|
||||
--config $CONFIG
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-federation-api-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-federation-api-server \
|
||||
--config $CONFIG
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-federation-sender-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-federation-sender-server \
|
||||
--config $CONFIG
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-media-api-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-media-api-server \
|
||||
--config $CONFIG
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-public-rooms-api-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-public-rooms-api-server \
|
||||
--config $CONFIG
|
||||
9
docker/microservices/dendrite-room-server.Dockerfile
Normal file
9
docker/microservices/dendrite-room-server.Dockerfile
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-room-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-room-server \
|
||||
--config $CONFIG
|
||||
9
docker/microservices/dendrite-sync-api-server.Dockerfile
Normal file
9
docker/microservices/dendrite-sync-api-server.Dockerfile
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-sync-api-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-sync-api-server \
|
||||
--config $CONFIG
|
||||
9
docker/microservices/dendrite-typing-server.Dockerfile
Normal file
9
docker/microservices/dendrite-typing-server.Dockerfile
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/dendrite-typing-server /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /dendrite-typing-server \
|
||||
--config $CONFIG
|
||||
13
docker/microservices/federation-api-proxy.Dockerfile
Normal file
13
docker/microservices/federation-api-proxy.Dockerfile
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
FROM dendrite:latest as build-env
|
||||
|
||||
# Copy the binary from build container to final container
|
||||
FROM alpine:3.10
|
||||
COPY --from=build-env /app/bin/federation-api-proxy /
|
||||
|
||||
# Component specific entrypoint, environment variables, and arguments
|
||||
CMD /federation-api-proxy \
|
||||
-bind-address $FEDERATION_BIND_ADDRESS \
|
||||
-media-api-server-url $MEDIA_API_SERVER_URL \
|
||||
-federation-api-url $FEDERATION_API_URL \
|
||||
-tls-cert $FEDERATION_TLS_CERT \
|
||||
-tls-key $FEDERATION_TLS_KEY
|
||||
25
docker/microservices/readme.md
Normal file
25
docker/microservices/readme.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Docker Images
|
||||
|
||||
## Build
|
||||
|
||||
The main `Dockerfile` builds installs all go modules and builds all the go binaries in `golang:1.12.9`, and should be tagged `dendrite:latest`. This tag is ensures that it cannot be pushed, and a CI/CD server should not have it cached.
|
||||
|
||||
All the other containers are generated from the binaries built in the first container. It copies the binary from `dendrite:latest` to the root of `alpine:3.10`.
|
||||
|
||||
## Usage
|
||||
|
||||
## Environment Variables
|
||||
|
||||
```yaml
|
||||
# bind-address arg to client-api-proxy
|
||||
client-bind-address
|
||||
# bind-address arg to federation-api-proxy
|
||||
federation-bind-address
|
||||
|
||||
client-api-server-url
|
||||
sync-api-server-url
|
||||
media-api-server-url
|
||||
public-rooms-api-server-url
|
||||
federation-api-url
|
||||
config
|
||||
```
|
||||
Loading…
Reference in a new issue