- update: Dockerfile layer reordering to speed up build times and lower image space needed

- add: .dockerignore file to reduce file transfers and remove unneeded files in image
This commit is contained in:
2024-12-21 13:10:37 -05:00
parent 0777bd4605
commit 754522b080
10 changed files with 101 additions and 63 deletions

View File

@@ -1,17 +1,19 @@
# Use Rust official image for building the application
FROM rust:1.83 AS builder
FROM rust:1.83-slim-bookworm AS builder
LABEL authors="raven"
WORKDIR /usr/src/proto
COPY ./proto .
WORKDIR /usr/src/utils
COPY ./utils .
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends --assume-yes \
protobuf-compiler
pkg-config \
libssl-dev \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/utils
COPY ./utils .
WORKDIR /usr/src/proto
COPY ./proto .
# Set the working directory
WORKDIR /usr/src/auth-service