mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-19 22:41:13 +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
|
||||
|
||||
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
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