Compare commits

...

12 Commits

Author SHA1 Message Date
Dmitry Belyaev 4f26722592
use cargo-chef to cache build
continuous-integration/drone/push Build is passing Details
2023-08-18 12:04:27 +03:00
Dmitry Belyaev a23a36fa5b
add pre-commit config 2023-08-18 11:51:06 +03:00
Dmitry Belyaev b9762fa150
add .dockerignore 2023-08-18 11:40:57 +03:00
Dmitry Belyaev 4c2c957472
use stable rust 2023-08-18 11:21:08 +03:00
Dmitry Belyaev ebe8970ada
upd app 2023-08-18 11:18:53 +03:00
Dmitry Belyaev a6783d673a
mini_moka
continuous-integration/drone/push Build is passing Details
2023-04-04 11:46:33 +03:00
Dmitry Belyaev e5c7761dc6
fix docker-compose.yml
continuous-integration/drone/push Build is passing Details
2023-04-03 16:07:57 +03:00
Dmitry Belyaev 989201bfc8
upd app
continuous-integration/drone/push Build is passing Details
2023-04-03 15:45:06 +03:00
Dmitry Belyaev 55c1f5c6f0
Merge branch 'master' of ssh://gitea.b4tman.ru/b4tman/qchgk_web_docker
continuous-integration/drone/push Build is passing Details
# Conflicts:
#	.drone.yml
2023-04-02 17:28:12 +03:00
Dmitry Belyaev d01a63a7c0
Merge branch 'rocket' 2023-04-02 17:27:32 +03:00
Dmitry Belyaev 72682925a0
ci: fix repo name for push
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
b4tman/qchgk_web_docker#1
2023-03-29 10:45:24 +03:00
Dmitry Belyaev 66cf530a2b
add package publish
continuous-integration/drone/push Build is failing Details
b4tman/qchgk_web_docker#1
2023-03-29 10:36:04 +03:00
5 changed files with 44 additions and 19 deletions

6
.dockerignore Normal file
View File

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

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

@ -1 +1 @@
Subproject commit d1cb2187c1a74b394df651cb244cbf93982493cb
Subproject commit da962a9f7ae7e398f52fcc85518879dadfef8b79