- 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:
13
.dockeringnore
Normal file
13
.dockeringnore
Normal file
@@ -0,0 +1,13 @@
|
||||
**/.idea/
|
||||
**/.venv/
|
||||
**/dist/
|
||||
**/target/
|
||||
**/node_modules/
|
||||
.git/
|
||||
npm-debug.log
|
||||
.coverage
|
||||
.coverage.*
|
||||
.env
|
||||
.env*
|
||||
.aws
|
||||
**/nginx.conf.example
|
||||
@@ -1,18 +1,20 @@
|
||||
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 \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
protobuf-compiler \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /usr/src/utils
|
||||
COPY ./utils .
|
||||
|
||||
WORKDIR /usr/src/proto
|
||||
COPY ./proto .
|
||||
|
||||
WORKDIR /usr/src/api-service
|
||||
COPY ./api-service .
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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 .
|
||||
|
||||
WORKDIR /usr/src/character-service
|
||||
COPY ./character-service .
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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 .
|
||||
|
||||
WORKDIR /usr/src/database-service
|
||||
COPY ./database-service .
|
||||
|
||||
10
frontend/.dockeringnore
Normal file
10
frontend/.dockeringnore
Normal file
@@ -0,0 +1,10 @@
|
||||
**/.idea/
|
||||
**/node_modules/
|
||||
**/dist
|
||||
.git
|
||||
npm-debug.log
|
||||
.coverage
|
||||
.coverage.*
|
||||
.env
|
||||
.aws
|
||||
nginx.conf*
|
||||
@@ -1,21 +1,17 @@
|
||||
# Step 1: Build the React app
|
||||
FROM node:20 AS build
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and install dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy the source code
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
|
||||
# Build the React app
|
||||
RUN npm run build
|
||||
|
||||
# Step 2: Serve the React app using nginx
|
||||
FROM nginx:1.25
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the built React files to the nginx html folder
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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 .
|
||||
|
||||
WORKDIR /usr/src/packet-service
|
||||
COPY ./packet-service .
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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 .
|
||||
|
||||
WORKDIR /usr/src/session-service
|
||||
COPY ./session-service .
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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 .
|
||||
|
||||
WORKDIR /usr/src/world-service
|
||||
COPY ./world-service .
|
||||
|
||||
Reference in New Issue
Block a user