Skip to content

Commit 463a074

Browse files
committed
try fix
1 parent 7eda979 commit 463a074

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

dockerfiles/Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ COPY assets assets/
7777
COPY .sqlx .sqlx/
7878
COPY migrations migrations/
7979

80+
ARG PROFILE_DIR=release
8081
RUN --mount=type=cache,target=/usr/local/cargo/registry,id=cargo-registry,sharing=locked \
8182
--mount=type=cache,target=/build/target,id=cargo-target,sharing=locked \
82-
cargo build --profile=$PROFILE
83+
mkdir /artifacts && \
84+
cargo build --profile=$PROFILE \
85+
cp /build/target/$PROFILE_DIR/cratesfyi /artifacts/
8386

8487
######################
8588
# Web server stage #
@@ -106,8 +109,7 @@ WORKDIR /srv/docsrs
106109
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
107110
CMD ["start-web-server", "0.0.0.0:3000"]
108111

109-
ARG PROFILE_DIR=release
110-
COPY --from=build /build/target/$PROFILE_DIR/cratesfyi /usr/local/bin
112+
COPY --from=build /artifacts/cratesfyi /usr/local/bin
111113
COPY static /srv/docsrs/static
112114
COPY vendor /srv/docsrs/vendor
113115

@@ -143,8 +145,7 @@ RUN apt-get update \
143145
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
144146
CMD ["start-build-server", "0.0.0.0:3000"]
145147

146-
ARG PROFILE_DIR=release
147-
COPY --from=build /build/target/$PROFILE_DIR/cratesfyi /usr/local/bin
148+
COPY --from=build /artifacts/cratesfyi /usr/local/bin
148149

149150
############################
150151
# Registry watcher stage #
@@ -169,8 +170,7 @@ RUN apt-get update \
169170
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
170171
CMD ["start-registry-watcher", "0.0.0.0:3000", "--repository-stats-updater=enabled", "--cdn-invalidator=enabled", "--queue-rebuilds=enabled"]
171172

172-
ARG PROFILE_DIR=release
173-
COPY --from=build /build/target/$PROFILE_DIR/cratesfyi /usr/local/bin
173+
COPY --from=build /artifacts/cratesfyi /usr/local/bin
174174

175175
###############
176176
# CLI stage #
@@ -200,5 +200,4 @@ COPY migrations migrations/
200200

201201
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
202202

203-
ARG PROFILE_DIR=release
204-
COPY --from=build /build/target/$PROFILE_DIR/cratesfyi /usr/local/bin
203+
COPY --from=build /artifacts/cratesfyi /usr/local/bin

0 commit comments

Comments
 (0)