diff --git a/Dockerfile b/Dockerfile index 2c0914d..5bbdf0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,9 @@ -FROM rust:latest - -ENV ROCKET_ADDRESS=0.0.0.0 -ENV ROCKET_PORT=8000 - -WORKDIR /app - -RUN cargo install cargo-watch - -COPY ./ ./ - -RUN cargo build +FROM rust:latest as builder +WORKDIR /portfolio +COPY . . +RUN cargo build --release + +FROM debian:bullseye-slim +#RUN apt-get update && apt-get install -y PRIPADNE_DEPS && rm -rf /var/lib/apt/lists/* +COPY --from=builder /portfolio/target/release/portfolio /usr/local/bin/portfolio +CMD ["portfolio"] diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..64c4c9c --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,19 @@ +FROM node:19-bullseye-slim + +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN npm i -g pnpm +RUN pnpm install + +COPY . . + +RUN pnpm run build + + +FROM node:19-bullseye-slim +WORKDIR /app +COPY --from=0 /app . +COPY . . + +EXPOSE 3000 +CMD ["node", "./build"] \ No newline at end of file