mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-06 03:06:04 +00:00
feat: new CI pipeline [skip ci]
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
Dockerfile
|
||||||
target
|
target
|
||||||
.mongo
|
.mongo
|
||||||
.env
|
.env
|
||||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Build Stage
|
||||||
|
FROM rustlang/rust:nightly-slim AS builder
|
||||||
|
USER 0:0
|
||||||
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
|
# Install build requirements
|
||||||
|
RUN apt-get update && apt-get install -y libssl-dev pkg-config
|
||||||
|
|
||||||
|
# Build all crates
|
||||||
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
COPY crates ./crates
|
||||||
|
RUN cargo build --locked --release
|
||||||
7
build.sh
Executable file
7
build.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Build base image
|
||||||
|
docker build -t revolt.chat/base:latest -f Dockerfile .
|
||||||
|
|
||||||
|
# Build crates
|
||||||
|
docker build -t revolt.chat/delta:latest -f crates/delta/Dockerfile .
|
||||||
|
docker build -t revolt.chat/bonfire:latest -f crates/bonfire/Dockerfile .
|
||||||
@@ -1,19 +1,10 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM rustlang/rust:nightly-slim AS builder
|
FROM revolt.chat/base:latest AS builder
|
||||||
USER 0:0
|
RUN cargo install --locked --path crates/bonfire
|
||||||
WORKDIR /home/rust/src
|
|
||||||
|
|
||||||
RUN USER=root cargo new --bin bonfire
|
|
||||||
WORKDIR /home/rust/src/bonfire
|
|
||||||
RUN apt-get update && apt-get install -y libssl-dev pkg-config
|
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
|
||||||
COPY src ./src
|
|
||||||
RUN cargo install --locked --path .
|
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
FROM debian:buster-slim
|
FROM debian:buster-slim
|
||||||
RUN apt-get update && apt-get install -y ca-certificates
|
RUN apt-get update && apt-get install -y ca-certificates
|
||||||
COPY --from=builder /usr/local/cargo/bin/bonfire ./
|
COPY --from=builder /usr/local/cargo/bin/revolt-bonfire ./
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
CMD ["./bonfire"]
|
CMD ["./revolt-bonfire"]
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM rustlang/rust:nightly-slim AS builder
|
FROM revolt.chat/base:latest AS builder
|
||||||
USER 0:0
|
RUN cargo install --locked --path crates/delta
|
||||||
WORKDIR /home/rust/src
|
|
||||||
|
|
||||||
RUN USER=root cargo new --bin revolt
|
|
||||||
WORKDIR /home/rust/src/revolt
|
|
||||||
RUN apt-get update && apt-get install -y libssl-dev pkg-config
|
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
|
||||||
COPY assets ./assets
|
|
||||||
COPY src ./src
|
|
||||||
RUN cargo install --locked --path .
|
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
FROM debian:buster-slim
|
FROM debian:buster-slim
|
||||||
RUN apt-get update && apt-get install -y ca-certificates
|
RUN apt-get update && apt-get install -y ca-certificates
|
||||||
COPY --from=builder /usr/local/cargo/bin/revolt ./
|
COPY --from=builder /usr/local/cargo/bin/revolt-delta ./
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
ENV ROCKET_ADDRESS 0.0.0.0
|
ENV ROCKET_ADDRESS 0.0.0.0
|
||||||
ENV ROCKET_PORT 8000
|
ENV ROCKET_PORT 8000
|
||||||
CMD ["./revolt"]
|
CMD ["./revolt-delta"]
|
||||||
|
|||||||
Reference in New Issue
Block a user