diff options
author | Daniel Wiesenberg <weasy@hotmail.de> | 2020-08-01 18:20:30 +0200 |
---|---|---|
committer | Daniel Wiesenberg <weasy@hotmail.de> | 2020-08-11 15:38:24 +0200 |
commit | 0338053774197c0c4df0729af6a034b30ac7f907 (patch) | |
tree | 296a2a3b411f827c003fe6df9ef3db56b01fe1a8 | |
parent | ecb641624425dba5dc6b10330b5a91d084b40f6b (diff) | |
download | conduit-0338053774197c0c4df0729af6a034b30ac7f907.zip |
Add ability to switch between local and remote build with build arg a...
...nd add env vars to docker-compose
-rw-r--r-- | Dockerfile | 15 | ||||
-rw-r--r-- | docker-compose.yml | 11 |
2 files changed, 19 insertions, 7 deletions
@@ -7,6 +7,10 @@ # Alpine build image to build Conduits statically compiled binary FROM alpine:3.12 as builder +# Specifies if the local project is build or if the git master branch +# is build. +ARG LOCAL=false + # Add 'edge'-repository to get Rust 1.45 RUN sed -i \ -e 's|v3\.12|edge|' \ @@ -17,10 +21,15 @@ RUN apk add --no-cache \ cargo \ openssl-dev -# Copy project from current folder and build it + +# Copy project files from current folder COPY . . -RUN cargo install --path . -#RUN cargo install --git "https://git.koesters.xyz/timo/conduit.git" +# Build it from local files or from official git repository +RUN if [[ $LOCAL == "true" ]]; then \ + cargo install --path . ; \ + else \ + cargo install --git "https://git.koesters.xyz/timo/conduit.git" ; \ + fi ########################## RUNTIME IMAGE ########################## # Create new stage with a minimal image for the actual diff --git a/docker-compose.yml b/docker-compose.yml index d0e4135..36a928f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,10 +12,13 @@ services: environment: ROCKET_SERVER_NAME: example.com # replace with your own name ### Uncomment and change values as needed - #ROCKET_LOG: normal - #ROCKET_REGISTRATION_DISABLED: 'true' - #ROCKET_DATABASE_PATH: /data/sled - #ROCKET_WORKERS: 10 + # ROCKET_LOG: normal + # ROCKET_PORT: 14004 + # ROCKET_REGISTRATION_DISABLED: 'true' + # ROCKET_ENCRYPTION_DISABLED: 'true' + # ROCKET_DATABASE_PATH: /srv/conduit/.local/share/conduit + # ROCKET_WORKERS: 10 + # ROCKET_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB volumes: db: |