Compare commits
15 commits
Author | SHA1 | Date | |
---|---|---|---|
9a6e9202fb | |||
5ff0387f0f | |||
7bce6230a6 | |||
4eade74f88 | |||
9089495497 | |||
582d8e8168 | |||
080e0320df | |||
d9c05dd1ca | |||
45a8c743ab | |||
fd295d16f0 | |||
2a7bc4ac39 | |||
b7ca35d6df | |||
e033c3b62e | |||
f0349c9094 | |||
daff823974 |
3 changed files with 32 additions and 89 deletions
43
.drone.yml
43
.drone.yml
|
@ -19,17 +19,6 @@ steps:
|
||||||
- cd meta
|
- cd meta
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- cd ..
|
- cd ..
|
||||||
- rm rust-toolchain
|
|
||||||
- chown -R 991:991 .
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: asonix/rust-builder:latest-linux-amd64
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- cargo build --target=$TARGET --release
|
|
||||||
- $TOOL-strip target/$TARGET/release/conduit
|
|
||||||
- cp target/$TARGET/release/conduit .
|
|
||||||
- cp conduit conduit-linux-amd64
|
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
image: plugins/docker:20
|
image: plugins/docker:20
|
||||||
|
@ -44,15 +33,6 @@ steps:
|
||||||
build_args:
|
build_args:
|
||||||
- REPO_ARCH=amd64
|
- REPO_ARCH=amd64
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: plugins/gitea-release:1
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
||||||
base_url: https://git.asonix.dog
|
|
||||||
files:
|
|
||||||
- conduit-linux-amd64
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
@ -64,7 +44,7 @@ type: docker
|
||||||
name: publish-arm64v8
|
name: publish-arm64v8
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
arch: amd64
|
arch: arm64
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true
|
||||||
|
@ -80,17 +60,6 @@ steps:
|
||||||
- cd meta
|
- cd meta
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- cd ..
|
- cd ..
|
||||||
- rm rust-toolchain
|
|
||||||
- chown -R 991:991 .
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: asonix/rust-builder:latest-linux-arm64v8
|
|
||||||
pull: always
|
|
||||||
commands:
|
|
||||||
- cargo build --target=$TARGET --release
|
|
||||||
- $TOOL-strip target/$TARGET/release/conduit
|
|
||||||
- cp target/$TARGET/release/conduit .
|
|
||||||
- cp conduit conduit-linux-arm64v8
|
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
image: plugins/docker:20
|
image: plugins/docker:20
|
||||||
|
@ -105,15 +74,6 @@ steps:
|
||||||
build_args:
|
build_args:
|
||||||
- REPO_ARCH=arm64v8
|
- REPO_ARCH=arm64v8
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: plugins/gitea-release:1
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
||||||
base_url: https://git.asonix.dog
|
|
||||||
files:
|
|
||||||
- conduit-linux-arm64v8
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
@ -137,7 +97,6 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- git clone $DRONE_GIT_HTTP_URL .
|
- git clone $DRONE_GIT_HTTP_URL .
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- chown -R 991:991 .
|
|
||||||
|
|
||||||
- name: manifest
|
- name: manifest
|
||||||
image: plugins/manifest:1
|
image: plugins/manifest:1
|
||||||
|
|
55
Dockerfile
55
Dockerfile
|
@ -1,28 +1,35 @@
|
||||||
ARG REPO_ARCH=amd64
|
ARG REPO_ARCH
|
||||||
|
|
||||||
# production environment
|
FROM $REPO_ARCH/alpine:edge as base
|
||||||
FROM asonix/rust-runner:$REPO_ARCH-latest
|
|
||||||
|
ARG UID=991
|
||||||
|
ARG GID=991
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
addgroup --gid "${GID}" app && \
|
||||||
|
adduser -D -G app -u "${UID}" -g "" -h /opt/app app && \
|
||||||
|
apk add tini libgcc libstdc++ musl
|
||||||
|
|
||||||
|
FROM base as builder
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk add clang15 clang15-dev linux-headers gcc g++ make cargo rust rustfmt
|
||||||
|
|
||||||
|
USER app
|
||||||
|
|
||||||
|
COPY --chown=app:app . /conduit
|
||||||
|
|
||||||
|
WORKDIR /conduit
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
cargo build --release --no-default-features --features conduit_bin,backend_rocksdb && \
|
||||||
|
strip target/release/conduit
|
||||||
|
|
||||||
|
FROM base as runner
|
||||||
|
|
||||||
|
COPY --from=builder /conduit/target/release/conduit /usr/local/bin/conduit
|
||||||
|
|
||||||
ENV CONDUIT_CONFIG="/opt/app/conduit.toml"
|
ENV CONDUIT_CONFIG="/opt/app/conduit.toml"
|
||||||
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk add --no-cache \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
libgcc \
|
|
||||||
libstdc++
|
|
||||||
|
|
||||||
COPY conduit /usr/local/bin/conduit
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
chown -R app:app /mnt
|
|
||||||
|
|
||||||
COPY meta/conduit.toml /opt/app/conduit.toml
|
|
||||||
|
|
||||||
VOLUME /mnt
|
|
||||||
USER app
|
USER app
|
||||||
EXPOSE 8080
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
CMD [ "/usr/local/bin/conduit" ]
|
||||||
CMD /usr/local/bin/conduit
|
|
||||||
|
|
23
conduit.toml
23
conduit.toml
|
@ -1,23 +0,0 @@
|
||||||
[global]
|
|
||||||
# This is the only directory where Conduit will save its data
|
|
||||||
database_path = "/mnt/conduit_db"
|
|
||||||
|
|
||||||
# The port Conduit will be running on. You need to set up a reverse proxy in
|
|
||||||
# your web server (e.g. apache or nginx), so all requests to /_matrix on port
|
|
||||||
# 443 and 8448 will be forwarded to the Conduit instance running on this port
|
|
||||||
port = 6167
|
|
||||||
|
|
||||||
# Max size for uploads
|
|
||||||
max_request_size = 40_000_000 # in bytes
|
|
||||||
|
|
||||||
# Enables registration. If set to false, no users can register on this server.
|
|
||||||
allow_registration = true
|
|
||||||
|
|
||||||
# Disable encryption, so no new encrypted rooms can be created
|
|
||||||
# Note: existing rooms will continue to work
|
|
||||||
allow_encryption = true
|
|
||||||
allow_federation = true
|
|
||||||
|
|
||||||
trusted_servers = ["matrix.org"]
|
|
||||||
|
|
||||||
address = "0.0.0.0"
|
|
Loading…
Reference in a new issue