docker sht
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m7s
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m7s
This commit is contained in:
parent
9aeea66f22
commit
5eb085067d
@ -11,10 +11,10 @@ WORKDIR /app/backend
|
|||||||
COPY backend/ .
|
COPY backend/ .
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
# Final Stage: Combine frontend and backend
|
# Final Stage
|
||||||
FROM debian:bullseye-slim
|
FROM debian:bullseye-slim
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=frontend-builder /app/frontend/build ./frontend/dist
|
COPY --from=frontend-builder /app/frontend/build ./frontend/build
|
||||||
COPY --from=backend-builder /app/backend/target/release/formies_be ./formies_be
|
COPY --from=backend-builder /app/backend/target/release/formies_be ./formies_be
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD ["./backend"]
|
CMD ["./formies_be"]
|
@ -24,7 +24,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.allow_any_method(),
|
.allow_any_method(),
|
||||||
)
|
)
|
||||||
.app_data(web::Data::new(db.clone()))
|
.app_data(web::Data::new(db.clone()))
|
||||||
.service(fs::Files::new("/", "./frontend/dist").index_file("index.html"))
|
.service(fs::Files::new("/", "frontend/build").index_file("index.html"))
|
||||||
.route("/login", web::post().to(handlers::login)) // Public: Login
|
.route("/login", web::post().to(handlers::login)) // Public: Login
|
||||||
.route(
|
.route(
|
||||||
"/forms/{id}/submissions",
|
"/forms/{id}/submissions",
|
||||||
@ -37,7 +37,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
web::get().to(handlers::get_submissions), // Protected
|
web::get().to(handlers::get_submissions), // Protected
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.bind("127.0.0.1:8080")?
|
.bind("0.0.0.0:8080")?
|
||||||
.run()
|
.run()
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user