This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
migrations/*.sql text eol=crlf
|
||||||
3
build.rs
Normal file
3
build.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=migrations");
|
||||||
|
}
|
||||||
@@ -17,11 +17,16 @@ RUN sed -i "s|http://deb.debian.org/debian|${DEBIAN_MIRROR%/}|g" /etc/apt/source
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
COPY build.rs ./
|
||||||
COPY .cargo ./.cargo
|
COPY .cargo ./.cargo
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY migrations ./migrations
|
COPY migrations ./migrations
|
||||||
COPY templates ./templates
|
COPY templates ./templates
|
||||||
|
|
||||||
|
# SQLx hashes migration bytes at compile time. Production was initialized from
|
||||||
|
# CRLF migrations, so make every build reproduce those historical checksums.
|
||||||
|
RUN sed -i 's/\r$//; s/$/\r/' migrations/*.sql
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
--mount=type=cache,target=/app/target,sharing=locked \
|
--mount=type=cache,target=/app/target,sharing=locked \
|
||||||
if [ -n "$CARGO_REGISTRY_MIRROR" ]; then \
|
if [ -n "$CARGO_REGISTRY_MIRROR" ]; then \
|
||||||
@@ -58,7 +63,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --from=builder /app/imageforge ./imageforge
|
COPY --from=builder /app/imageforge ./imageforge
|
||||||
COPY --from=frontend-builder /app/frontend/dist ./static
|
COPY --from=frontend-builder /app/frontend/dist ./static
|
||||||
COPY migrations ./migrations
|
COPY --from=builder /app/migrations ./migrations
|
||||||
|
|
||||||
RUN mkdir -p uploads \
|
RUN mkdir -p uploads \
|
||||||
&& chown imageforge:imageforge uploads
|
&& chown imageforge:imageforge uploads
|
||||||
|
|||||||
Reference in New Issue
Block a user