mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-09 17:19:49 -04:00
Working on getting the dev/local operating.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -21,14 +21,13 @@ services:
|
||||
retries: 3
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
user: "1000:1000" # Non-root user
|
||||
|
||||
frontend:
|
||||
extends:
|
||||
file: compose.yml
|
||||
service: frontend
|
||||
volumes:
|
||||
- ./frontend/src:/app/src
|
||||
- ./frontend/build:/app/build
|
||||
- ./frontend/package.json:/app/package.json
|
||||
- ./frontend/yarn.lock:/app/yarn.lock
|
||||
command: ["yarn", "start"]
|
||||
@@ -45,7 +44,6 @@ services:
|
||||
retries: 3
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
user: "1000:1000" # Non-root user
|
||||
|
||||
postgres:
|
||||
extends:
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# Dockerfile for building and serving a React application using TypeScript
|
||||
# This Dockerfile uses a multi-stage build to keep the final image size small.
|
||||
# It builds the application in a Node.js environment and serves it using a lightweight server.
|
||||
|
||||
# The User ID can be passed as a build argument to run the container as a non-root user.
|
||||
ARG USER_ID=$(id -u)
|
||||
|
||||
# The Node.js version can be passed as a build argument.
|
||||
ARG NODE_VERSION=24.6.0
|
||||
|
||||
# Build stage
|
||||
FROM node:24.6.0 AS builder
|
||||
FROM node:${NODE_VERSION} AS builder
|
||||
|
||||
# Set the User ID for non-root user
|
||||
USER ${USER_ID}
|
||||
|
||||
# Setting working directory for build
|
||||
WORKDIR /app
|
||||
@@ -23,7 +36,10 @@ COPY . .
|
||||
RUN yarn run build
|
||||
|
||||
# Production stage
|
||||
FROM node:24.6.0-slim
|
||||
FROM node:${NODE_VERSION}-slim
|
||||
|
||||
# Set the User ID for non-root user
|
||||
USER ${USER_ID}
|
||||
|
||||
# Setting working directory for build
|
||||
WORKDIR /app
|
||||
|
||||
Reference in New Issue
Block a user