mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-06 19:40:49 +00:00
feat: add dockerfile for backend & frontend
This commit is contained in:
parent
efb1cf1d3d
commit
ed1aa692a2
2 changed files with 28 additions and 12 deletions
21
Dockerfile
21
Dockerfile
|
|
@ -1,12 +1,9 @@
|
||||||
FROM rust:latest
|
FROM rust:latest as builder
|
||||||
|
WORKDIR /portfolio
|
||||||
ENV ROCKET_ADDRESS=0.0.0.0
|
COPY . .
|
||||||
ENV ROCKET_PORT=8000
|
RUN cargo build --release
|
||||||
|
|
||||||
WORKDIR /app
|
FROM debian:bullseye-slim
|
||||||
|
#RUN apt-get update && apt-get install -y PRIPADNE_DEPS && rm -rf /var/lib/apt/lists/*
|
||||||
RUN cargo install cargo-watch
|
COPY --from=builder /portfolio/target/release/portfolio /usr/local/bin/portfolio
|
||||||
|
CMD ["portfolio"]
|
||||||
COPY ./ ./
|
|
||||||
|
|
||||||
RUN cargo build
|
|
||||||
|
|
|
||||||
19
frontend/Dockerfile
Normal file
19
frontend/Dockerfile
Normal 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"]
|
||||||
Loading…
Reference in a new issue