works
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -5,6 +5,7 @@ COPY ./markdown_backend ./markdown_backend
|
||||
WORKDIR /build/markdown_backend
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
RUN apt-get update && apt-get install -y musl-tools
|
||||
# Build with musl target for static linking
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
FROM node:20
|
||||
@@ -16,12 +17,20 @@ COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
# Ensure posts directory exists and has correct permissions
|
||||
RUN mkdir -p /app/posts
|
||||
COPY posts/* /app/posts/
|
||||
RUN chmod -R 755 /app/posts
|
||||
|
||||
# Copy the Rust binary from the build stage
|
||||
COPY --from=rust-build /build/markdown_backend/target/release/markdown_backend ./markdown_backend/target/release/markdown_backend
|
||||
# Copy the statically linked Rust binary from the build stage
|
||||
COPY --from=rust-build /build/markdown_backend/target/x86_64-unknown-linux-musl/release/markdown_backend ./markdown_backend/target/release/markdown_backend
|
||||
RUN chmod +x ./markdown_backend/target/release/markdown_backend
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# Create and set permissions for the docker volume mount point
|
||||
RUN mkdir -p /app/docker && chmod 777 /app/docker
|
||||
|
||||
VOLUME ["/app/docker"]
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
Reference in New Issue
Block a user