Skip to content

Commit

Permalink
Merge pull request #99 from yanshiyason/patch-1
Browse files Browse the repository at this point in the history
Update deployment.md
  • Loading branch information
mischov authored Jun 1, 2020
2 parents 36d3f74 + 4ba31b7 commit 99d6616
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions guides/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@ For example:
heroku buildpacks:add -i 1 https://github.com/emk/heroku-buildpack-rust.git
echo "RUST_SKIP_BUILD=1" > RustConfig
```

### Deploying with Docker

Make sure rust is installed prior to running `mix deps.compile`. You can see examples of what commands to include in your Dockerfile by looking at the official rust Dockerfiles. For example, here are the commands for [`alpine3.11`](https://github.com/rust-lang/docker-rust/blob/009cc0a821ff773d54875350312731ed490d5cce/1.43.1/alpine3.11/Dockerfile) based images.

If your Dockerfile is separated into a `build stage` and a `release stage` rust only needs to be installed during the build phase. **However**, your image will need to have `libcc` installed during the `release stage`.

```
RUN apk add --no-cache libgcc
```

You will also need to have the folloing environment variable set during the `build` stage or else `mix compile` will fail.

```
RUSTFLAGS='--codegen target-feature=-crt-static'
```

0 comments on commit 99d6616

Please sign in to comment.