16 Commits

Author SHA1 Message Date
85bac6aca5 upd app (fix 500)
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-20 16:26:39 +03:00
3ffee54d1c upd app (json link)
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-20 14:13:44 +03:00
a95457dd4e upd app (error catchers + json)
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-20 13:47:43 +03:00
efe197238a upd app
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-18 22:33:43 +03:00
4f26722592 use cargo-chef to cache build
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-18 12:04:27 +03:00
a23a36fa5b add pre-commit config 2023-08-18 11:51:06 +03:00
b9762fa150 add .dockerignore 2023-08-18 11:40:57 +03:00
4c2c957472 use stable rust 2023-08-18 11:21:08 +03:00
ebe8970ada upd app 2023-08-18 11:18:53 +03:00
a6783d673a mini_moka
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-04 11:46:33 +03:00
e5c7761dc6 fix docker-compose.yml
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-03 16:07:57 +03:00
989201bfc8 upd app
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-03 15:45:06 +03:00
55c1f5c6f0 Merge branch 'master' of ssh://gitea.b4tman.ru/b4tman/qchgk_web_docker
All checks were successful
continuous-integration/drone/push Build is passing
# Conflicts:
#	.drone.yml
2023-04-02 17:28:12 +03:00
d01a63a7c0 Merge branch 'rocket' 2023-04-02 17:27:32 +03:00
9d24c83c5c from master
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-02 17:22:08 +03:00
ce023126fc upd app (add cache)
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-02 17:06:17 +03:00
6 changed files with 45 additions and 20 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
target
.git
.gitignore
.drone.yml
docker-compose.yml
.pre-commit-config.yaml

View File

@@ -53,4 +53,4 @@ trigger:
- actix
event:
- push
- tag
- tag

10
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

View File

@@ -1,25 +1,34 @@
FROM rustlang/rust:nightly-alpine as builder
FROM rust:1-alpine as chef
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
RUN apk add --no-cache musl-dev
RUN apk add --no-cache musl-dev curl
# install cargo-binstall
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh -o install-from-binstall-release.sh
RUN sh install-from-binstall-release.sh
# install cargo-chef
RUN cargo binstall -y cargo-chef
WORKDIR /home/rust/src
COPY Cargo.toml /home/rust/src/
COPY Cargo.lock /home/rust/src/
RUN mkdir /home/rust/src/src && \
echo 'fn main() {}' > /home/rust/src/src/main.rs
FROM chef AS planner
RUN cargo fetch
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
COPY --from=planner /home/rust/src/recipe.json recipe.json
# build & cache deps
RUN cargo chef cook --release --recipe-path recipe.json
# build app with cached deps
COPY . .
RUN cargo build --release
RUN rm -f /home/rust/src/src/main.rs
COPY src /home/rust/src/src
RUN touch /home/rust/src/src/main.rs
RUN cargo build -v --release
FROM scratch
COPY static /static

View File

@@ -1,10 +1,10 @@
version: '2'
services:
qchgk:
build:
context: src
dockerfile: ../Dockerfile
image: 'b4tman/qchgk:rocket'
#build:
# context: src
# dockerfile: ../Dockerfile
image: 'gitea.b4tman.ru/b4tman/qchgk:latest'
container_name: 'qchgk'
ports:
- '8088:8088'
@@ -19,4 +19,4 @@ services:
# RUST_BACKTRACE: 1
# RUST_BACKTRACE: full
volumes:
- '/data/lab/docker/qchgk_web/db:/db/:ro'
- './db.dat:/db.dat:ro'

2
src

Submodule src updated: b281f85a70...5da53f79e4