diff options
-rw-r--r-- | .qovery.yml | 17 | ||||
-rw-r--r-- | Dockerfile | 29 |
2 files changed, 39 insertions, 7 deletions
diff --git a/.qovery.yml b/.qovery.yml index 2178217..8f02572 100644 --- a/.qovery.yml +++ b/.qovery.yml @@ -1,11 +1,14 @@ ---- application: - name: "gico-api" - project: "gico" - organization: "QoveryCommunity" + name: gico-api + project: Gico + publicly_accessible: true +databases: +- type: postgresql + version: "12.0" + name: gico-api-pg-db-240321 routers: -- name: "main-gico-api" +- name: main routes: - - application_name: "gico-api" + - application_name: gico-api paths: - - "/*" + - / diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7ae6bd5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# build stage +FROM rust:latest as cargo-build + +RUN apt-get update && apt-get install musl-tools -y +RUN rustup target add x86_64-unknown-linux-musl + +WORKDIR /usr/src/app +COPY . . + +RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release +--target=x86_64-unknown-linux-musl + +################### +# final stage +FROM alpine:latest + +RUN addgroup -g 1000 app +RUN adduser -D -s /bin/sh -u 1000 -G app app + +WORKDIR /home/app/bin/ +COPY --from=cargo-build +/usr/src/app/target/x86_64-unknown-linux-musl/release/gico-api . + +RUN chown app:app gico-api +USER app + +EXPOSE 9090 + +CMD ["./gico-api"] |