Skip to content

Commit

Permalink
Turn slim-release into a full release (#1116)
Browse files Browse the repository at this point in the history
* Turn slim-release into a full release

* Make sure image has proper rust toolchain to build projects

* Update instructions

* Unify Dockerfiles
  • Loading branch information
pierd authored Oct 25, 2023
1 parent 749bb24 commit ae00ba6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
IMAGE_NAME: ${{ github.repository }}
BUILD_DIR: build-${{ github.sha }}
SERVER_BINARY_NAME: ambient-${{ github.sha }}
CANARY_SERVER_BINARY_NAME: ambient-0.3.0-dev
CANARY_SERVER_BINARY_NAME: ambient-0.3.1-dev

jobs:
build-and-push:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: slim-release.Dockerfile
file: Dockerfile
context: .
push: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
25 changes: 20 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# Basic Dockerfile to build and run the server in a Linux environment.
# The official Rust base Docker image uses Debian.
FROM rust:1.70.0
WORKDIR /app
# Instructions (replace "/path/to/your/project" with path to your project):
# 1. Build the image: docker build -f Dockerfile -t ambient .
# 2. Run the image: docker run -p 8999:8999/tcp -p 9000:9000/udp -v /path/to/your/project:/app/project ambient
# 3. Run `ambient join` locally to connect to the server

FROM rust:1.73-bullseye AS builder
RUN apt-get update && \
apt-get install -y \
zip build-essential cmake pkg-config \
libfontconfig1-dev clang libasound2-dev ninja-build \
libxcb-xfixes0-dev mesa-vulkan-drivers
libxcb-xfixes0-dev mesa-vulkan-drivers
ADD . /build
WORKDIR /build
RUN cargo build --release --no-default-features --features production
RUN strip target/release/ambient

FROM rust:1.73-bullseye
RUN apt-get update && \
apt-get install -y \
ca-certificates libasound2
RUN rustup toolchain install stable
RUN rustup target add --toolchain stable wasm32-wasi
WORKDIR /app
COPY --from=builder /build/target/release/ambient ./
CMD [ "./ambient", "serve", "--public-host", "localhost", "--release", "project" ]
3 changes: 1 addition & 2 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ rusty-hook = "^0.11.2"
[features]
no_bundled_certs = []
default = ["tls-webpki-roots"]
slim = ["stackdriver"]
production = ["assimp"]
production = ["assimp", "stackdriver"]
profile = ["ambient_app/profile"]
assimp = ["ambient_model_import/russimp"]
stackdriver = ["tracing-stackdriver"]
Expand Down
24 changes: 0 additions & 24 deletions slim-release.Dockerfile

This file was deleted.

0 comments on commit ae00ba6

Please sign in to comment.