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.lock ./Cargo.lock
|
||||||
COPY ./Cargo.toml ./Cargo.toml
|
COPY ./Cargo.toml ./Cargo.toml
|
||||||
|
|
||||||
|
ARG PROFILE
|
||||||
|
|
||||||
RUN cargo build
|
RUN cargo build
|
||||||
RUN rm src/*.rs
|
RUN rm src/*.rs
|
||||||
|
|
||||||
# Compile the source
|
# Compile the source
|
||||||
COPY ./src ./src
|
COPY ./src ./src
|
||||||
RUN rm ./target/release/deps/lonk*
|
RUN rm ./target/${PROFILE:-release}/deps/lonk*
|
||||||
RUN cargo build
|
RUN cargo build
|
||||||
|
|
||||||
# Execution container
|
# Execution container
|
||||||
FROM scratch
|
FROM rust:latest
|
||||||
COPY --from=build /lonk/target/release/lonk .
|
ARG PROFILE
|
||||||
|
COPY --from=builder /lonk/target/${PROFILE:-release}/lonk .
|
||||||
CMD ["./lonk"]
|
CMD ["./lonk"]
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"db": {
|
"db": {
|
||||||
"address": "redis://db"
|
"address": "redis://db",
|
||||||
|
"worker_threads": 4
|
||||||
},
|
},
|
||||||
"slug_rules": {
|
"slug_rules": {
|
||||||
"length": 5,
|
"length": 5,
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
version: '3.9'
|
version: '3.9'
|
||||||
services:
|
services:
|
||||||
lonk:
|
lonk:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
PROFILE: debug
|
||||||
environment:
|
environment:
|
||||||
- LONK_CONFIG="/data/config.json"
|
- LONK_CONFIG="/data/config.json"
|
||||||
- PROFILE="debug"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
redis:
|
redis:
|
||||||
|
|
Loading…
Reference in New Issue