Skip to content

Commit

Permalink
Merge pull request #203 from Far-Beyond-Dev/refactor/docker-infrastru…
Browse files Browse the repository at this point in the history
…cture

Refactor: Restructure Docker Configuration and Compose Setup
  • Loading branch information
tristanpoland authored Dec 7, 2024
2 parents dc6fc5b + 9d15b2a commit 1ae968e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7

ARG RUST_VERSION=1.82.0
ARG APP_NAME=horizon
ARG APP_NAME=horizon-server

################################################################################
# Create a stage for building the application.
Expand All @@ -27,17 +27,17 @@ RUN apk add --no-cache clang lld musl-dev git
# Leverage a bind mount to the src directory to avoid having to copy the
# source code into the container. Once built, copy the executable to an
# output directory before the cache mounted /app/target is unmounted.
RUN --mount=type=bind,source=src,target=src \
--mount=type=bind,source=plugin-api,target=plugin-api,readonly=false \
--mount=type=bind,source=plugins,target=plugins \
--mount=type=bind,source=config.yml,target=config.yml \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
RUN --mount=type=bind,source=./server/src,target=/app/server/src \
--mount=type=bind,source=./plugin_api,target=/app/plugin_api,readonly=false \
--mount=type=bind,source=./plugins,target=/app/plugins \
--mount=type=bind,source=./server/server_config.json,target=/app/server/server_config.json \
--mount=type=bind,source=./server/Cargo.toml,target=/app/server/Cargo.toml \
--mount=type=cache,target=/app/target/ \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cargo build --locked --release && \
cp ./target/release/$APP_NAME /bin/server
cd ./server && cargo build --release

RUN cp /app/server/target/release/horizon-server /bin/horizon-server

################################################################################
# Create a new stage for running the application that contains the minimal
Expand Down Expand Up @@ -65,10 +65,10 @@ RUN adduser \
USER appuser

# Copy the executable from the "build" stage.
COPY --from=build /bin/server /bin/
COPY --from=build /bin/$APP_NAME /bin/

# Expose the port that the application listens on.
EXPOSE 3000

# What the container should run when it is started.
CMD ["/bin/server"]
CMD ["/bin/horizon-server"]

0 comments on commit 1ae968e

Please sign in to comment.