Compare commits

...

2 Commits

Author SHA1 Message Date
meeg_leeto fc001933d1 fix: proper env w/ docker compose 2022-04-21 22:10:14 +01:00
meeg_leeto 63a404822a fix: dockerfile 2022-04-21 17:53:55 +01:00
3 changed files with 13 additions and 7 deletions

View File

@ -8,15 +8,18 @@ WORKDIR lonk
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
ARG PROFILE
RUN cargo build
RUN src/*.rs
RUN rm src/*.rs
# Compile the source
COPY ./src ./src
RUN rm ./target/release/deps/lonk*
RUN rm ./target/${PROFILE:-release}/deps/lonk*
RUN cargo build
# Execution container
FROM scratch
COPY --from=build /lonk/target/release/lonk .
FROM rust:latest
ARG PROFILE
COPY --from=builder /lonk/target/${PROFILE:-release}/lonk .
CMD ["./lonk"]

View File

@ -1,6 +1,7 @@
{
"db": {
"address": "redis://db"
"address": "redis://db",
"worker_threads": 4
},
"slug_rules": {
"length": 5,

View File

@ -1,10 +1,12 @@
version: '3.9'
services:
lonk:
build: .
build:
context: .
args:
PROFILE: debug
environment:
- LONK_CONFIG="/data/config.json"
- PROFILE="debug"
volumes:
- ./data:/data
redis: