Compare commits
3 commits
db6d4a34b9
...
5f2f5fc567
Author | SHA1 | Date | |
---|---|---|---|
|
5f2f5fc567 | ||
|
b0a1ca56b1 | ||
|
d72f150a3e |
28
.woodpecker.yml
Normal file
28
.woodpecker.yml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
pipeline:
|
||||||
|
backend:
|
||||||
|
image: rust
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgres://postgres:password@database:5432/postgres
|
||||||
|
commands:
|
||||||
|
- make
|
||||||
|
- make test
|
||||||
|
|
||||||
|
build_docker_img:
|
||||||
|
image: plugins/docker
|
||||||
|
when:
|
||||||
|
event: [pull_request]
|
||||||
|
settings:
|
||||||
|
dry_run: true
|
||||||
|
repo: realaravinth/dumbserve
|
||||||
|
tags: latest
|
||||||
|
|
||||||
|
build_and_publish_docker_img:
|
||||||
|
image: plugins/docker
|
||||||
|
when:
|
||||||
|
event: [push, tag, deployment]
|
||||||
|
settings:
|
||||||
|
username: realaravinth
|
||||||
|
password:
|
||||||
|
from_secret: DOCKER_TOKEN
|
||||||
|
repo: realaravinth/dumbserve
|
||||||
|
tags: latest
|
1039
Cargo.lock
generated
1039
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
13
Cargo.toml
13
Cargo.toml
|
@ -12,25 +12,26 @@ build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-files = "0.6.2"
|
actix-files = "0.6.2"
|
||||||
actix-multipart = "0.4"
|
actix-multipart = "0.6"
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
actix-web-httpauth = "0.8.0"
|
actix-web-httpauth = "0.8.0"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.5.0"
|
||||||
sanitize-filename = "0.4"
|
sanitize-filename = "0.5"
|
||||||
serde = { version = "1", features=["derive"]}
|
serde = { version = "1", features=["derive"]}
|
||||||
tokio = { version = "1.20.1", features = ["fs"]}
|
tokio = { version = "1.32", features = ["fs"]}
|
||||||
uuid = { version = "1", features = ["v4"] }
|
uuid = { version = "1", features = ["v4"] }
|
||||||
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] }
|
sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] }
|
||||||
actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" }
|
actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" }
|
||||||
derive_builder = "0.11.2"
|
derive_builder = "0.12"
|
||||||
argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"}
|
argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"}
|
||||||
config = "0.11"
|
config = "0.11"
|
||||||
derive_more = "0.99.17"
|
derive_more = "0.99.17"
|
||||||
url = { version = "2.2.2", features = ["serde"]}
|
url = { version = "2.2.2", features = ["serde"]}
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
actix = "0.13.0"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,4 +41,4 @@ sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "t
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.7.0"
|
actix-rt = "2.7.0"
|
||||||
base64 = "0.13.0"
|
base64 = "0.21.0"
|
||||||
|
|
39
Dockerfile
39
Dockerfile
|
@ -1,49 +1,14 @@
|
||||||
#FROM node:16.0.0 as frontend
|
|
||||||
#RUN set -ex; \
|
|
||||||
# apt-get update; \
|
|
||||||
# DEBIAN_FRONTEND=noninteractive \
|
|
||||||
# apt-get install -y --no-install-recommends make
|
|
||||||
#RUN mkdir -p /src/docs/openapi/
|
|
||||||
#COPY package.json yarn.lock /src/
|
|
||||||
#COPY docs/openapi/package.json docs/openapi/yarn.lock /src/docs/openapi/
|
|
||||||
#WORKDIR /src
|
|
||||||
#RUN yarn install && cd docs/openapi && yarn install
|
|
||||||
#WORKDIR /src
|
|
||||||
#RUN mkdir -p /src/static/cache/bundle
|
|
||||||
#COPY tsconfig.json webpack.config.js jest.config.ts /src/
|
|
||||||
#COPY templates /src/templates/
|
|
||||||
#COPY docs/openapi /src/docs/openapi/
|
|
||||||
#COPY Makefile /src/
|
|
||||||
#COPY scripts /src/scripts
|
|
||||||
#RUN make frontend
|
|
||||||
|
|
||||||
FROM rust:latest as planner
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
WORKDIR /src
|
|
||||||
COPY . /src/
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
FROM rust:latest as cacher
|
|
||||||
WORKDIR /src/
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
COPY --from=planner /src/recipe.json recipe.json
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
FROM rust:latest as rust
|
FROM rust:latest as rust
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=cacher /src/target target
|
|
||||||
#COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
|
|
||||||
RUN cargo --version
|
RUN cargo --version
|
||||||
#RUN make cache-bust
|
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM debian:bullseye as dumbserve
|
FROM debian:bookworm as dumbserve
|
||||||
LABEL org.opencontainers.image.source https://github.com/realaravinth/dumbserve
|
LABEL org.opencontainers.image.source https://git.batsense.net/realaravinth/dumbserve
|
||||||
RUN useradd -ms /bin/bash -u 1001 dumbserve
|
RUN useradd -ms /bin/bash -u 1001 dumbserve
|
||||||
WORKDIR /home/dumbserve
|
WORKDIR /home/dumbserve
|
||||||
COPY --from=rust /src/target/release/dumbserve /usr/local/bin/
|
COPY --from=rust /src/target/release/dumbserve /usr/local/bin/
|
||||||
#COPY --from=rust /src/config/default.toml /etc/dumbserve/config.toml
|
|
||||||
RUN mkdir /var/lib/dumbserve && chown dumbserve:dumbserve /var/lib/dumbserve
|
RUN mkdir /var/lib/dumbserve && chown dumbserve:dumbserve /var/lib/dumbserve
|
||||||
USER dumbserve
|
USER dumbserve
|
||||||
CMD [ "/usr/local/bin/dumbserve" ]
|
CMD [ "/usr/local/bin/dumbserve" ]
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -16,7 +16,7 @@ doc: ## Generate documentation
|
||||||
cargo doc --no-deps --workspace --all-features
|
cargo doc --no-deps --workspace --all-features
|
||||||
|
|
||||||
docker: ## Build Docker image
|
docker: ## Build Docker image
|
||||||
docker build -t realaravinth/dumbserve:master -t realaravinth/dumbserve:latest .
|
docker buildx build -t realaravinth/dumbserve:master -t realaravinth/dumbserve:latest --load .
|
||||||
|
|
||||||
docker-publish: docker ## Build and publish Docker image
|
docker-publish: docker ## Build and publish Docker image
|
||||||
docker push realaravinth/dumbserve:master
|
docker push realaravinth/dumbserve:master
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[![Docker](https://img.shields.io/docker/pulls/realaravinth/dumbserve)](https://hub.docker.com/r/realaravinth/dumbserve)
|
[![Docker](https://img.shields.io/docker/pulls/realaravinth/dumbserve)](https://hub.docker.com/r/realaravinth/dumbserve)
|
||||||
[![Build](https://github.com/realaravinth/dumbserve/actions/workflows/linux.yml/badge.svg)](https://github.com/realaravinth/dumbserve/actions/workflows/linux.yml)
|
[![status-badge](https://ci.batsense.net/api/badges/95/status.svg)](https://ci.batsense.net/repos/95)
|
||||||
[![dependency status](https://deps.rs/repo/github/realaravinth/dumbserve/status.svg)](https://deps.rs/repo/github/realaravinth/dumbserve)
|
[![dependency status](https://deps.rs/repo/github/realaravinth/dumbserve/status.svg)](https://deps.rs/repo/github/realaravinth/dumbserve)
|
||||||
[![codecov](https://codecov.io/gh/realaravinth/dumbserve/branch/master/graph/badge.svg)](https://codecov.io/gh/realaravinth/dumbserve)
|
[![codecov](https://codecov.io/gh/realaravinth/dumbserve/branch/master/graph/badge.svg)](https://codecov.io/gh/realaravinth/dumbserve)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue