fix: proper env w/ docker compose
This commit is contained in:
parent
63a404822a
commit
fc001933d1
|
@ -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"]
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"db": {
|
||||
"address": "redis://db"
|
||||
"address": "redis://db",
|
||||
"worker_threads": 4
|
||||
},
|
||||
"slug_rules": {
|
||||
"length": 5,
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue