Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
4f26722592
|
|||
a23a36fa5b
|
|||
b9762fa150
|
|||
4c2c957472
|
|||
ebe8970ada
|
|||
a6783d673a
|
|||
e5c7761dc6
|
|||
989201bfc8
|
|||
55c1f5c6f0
|
|||
d01a63a7c0
|
|||
9d24c83c5c
|
|||
ce023126fc
|
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
target
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.drone.yml
|
||||||
|
docker-compose.yml
|
||||||
|
.pre-commit-config.yaml
|
@@ -53,4 +53,4 @@ trigger:
|
|||||||
- actix
|
- actix
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
- tag
|
10
.pre-commit-config.yaml
Normal file
10
.pre-commit-config.yaml
Normal 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
|
35
Dockerfile
35
Dockerfile
@@ -1,25 +1,34 @@
|
|||||||
FROM rustlang/rust:nightly-alpine as builder
|
FROM rust:1-alpine as chef
|
||||||
|
|
||||||
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
|
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
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
COPY Cargo.toml /home/rust/src/
|
FROM chef AS planner
|
||||||
COPY Cargo.lock /home/rust/src/
|
|
||||||
RUN mkdir /home/rust/src/src && \
|
|
||||||
echo 'fn main() {}' > /home/rust/src/src/main.rs
|
|
||||||
|
|
||||||
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 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
|
FROM scratch
|
||||||
|
|
||||||
COPY static /static
|
COPY static /static
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
qchgk:
|
qchgk:
|
||||||
build:
|
#build:
|
||||||
context: src
|
# context: src
|
||||||
dockerfile: ../Dockerfile
|
# dockerfile: ../Dockerfile
|
||||||
image: 'b4tman/qchgk:rocket'
|
image: 'gitea.b4tman.ru/b4tman/qchgk:latest'
|
||||||
container_name: 'qchgk'
|
container_name: 'qchgk'
|
||||||
ports:
|
ports:
|
||||||
- '8088:8088'
|
- '8088:8088'
|
||||||
@@ -19,4 +19,4 @@ services:
|
|||||||
# RUST_BACKTRACE: 1
|
# RUST_BACKTRACE: 1
|
||||||
# RUST_BACKTRACE: full
|
# RUST_BACKTRACE: full
|
||||||
volumes:
|
volumes:
|
||||||
- '/data/lab/docker/qchgk_web/db:/db/:ro'
|
- './db.dat:/db.dat:ro'
|
||||||
|
2
src
2
src
Submodule src updated: b281f85a70...da962a9f7a
Reference in New Issue
Block a user