-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: Dockerfile for dev and prod * refactor: basic fly.toml setup - gpu is not available on my account
- Loading branch information
1 parent
94fbf55
commit 7a7c04e
Showing
5 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Prepare | ||
FROM rust as planner | ||
WORKDIR /app | ||
RUN cargo install cargo-chef | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
# Cook | ||
FROM rust as cacher | ||
WORKDIR /app | ||
RUN cargo install cargo-chef | ||
COPY --from=planner /app/recipe.json recipe.json | ||
RUN apt-get update && apt-get install -y -qq xorg xauth | ||
RUN cargo chef cook --release --features docker --recipe-path=recipe.json | ||
|
||
# Build | ||
FROM rust as builder | ||
COPY . /app | ||
WORKDIR /app | ||
COPY --from=cacher /app/target target | ||
COPY --from=cacher /usr/local/cargo /usr/local/cargo | ||
RUN apt-get update && apt-get install -y -qq xorg xauth | ||
RUN cargo build --release --features docker | ||
|
||
# RUN | ||
FROM ubuntu:22.04 | ||
COPY --from=builder /app/target/release/new_media /app/new_media | ||
WORKDIR /app | ||
# Build tools | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq xorg xauth | ||
# Bevy dependencies | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -yq libasound2-dev libudev-dev libxkbcommon-x11-0 | ||
# Graphics | ||
RUN apt-get update && apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers | ||
|
||
EXPOSE 8080 | ||
|
||
CMD xvfb-run -s "-screen 0 1024x768x24" "./new_media" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
app = 'new-media-still-surf-1038' | ||
primary_region = 'sjc' | ||
|
||
[build] | ||
dockerfile = 'Dockerfile.prod' | ||
|
||
[http_service] | ||
internal_port = 8080 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[[vm]] | ||
cpu_kind = 'performance' | ||
memory = '64gb' | ||
cpus = 16 | ||
size = "a100-40gb" |