feat: add dockerfile for backend & frontend

This commit is contained in:
EETagent 2022-12-14 12:05:11 +01:00
parent efb1cf1d3d
commit ed1aa692a2
2 changed files with 28 additions and 12 deletions

View file

@ -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"]

19
frontend/Dockerfile Normal file
View file

@ -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"]