fix: proper env w/ docker compose

This commit is contained in:
meeg_leeto 2022-04-21 22:10:14 +01:00
parent 63a404822a
commit fc001933d1
3 changed files with 12 additions and 6 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 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: