mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-08-24 00:06:26 -04:00
Working on building out the compose file for dev/local operations.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
66
compose.dev.yml
Normal file
66
compose.dev.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
services:
|
||||
backend:
|
||||
extends:
|
||||
file: compose.yml
|
||||
service: backend
|
||||
volumes:
|
||||
- ./backend/src:/app/src
|
||||
- ./backend/poetry.lock:/app/poetry.lock
|
||||
- ./backend/pyproject.toml:/app/pyproject.toml
|
||||
command: ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
restart: always
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
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/package.json:/app/package.json
|
||||
- ./frontend/yarn.lock:/app/yarn.lock
|
||||
command: ["yarn", "start"]
|
||||
restart: always
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
user: "1000:1000" # Non-root user
|
||||
|
||||
postgres:
|
||||
extends:
|
||||
file: compose.yml
|
||||
service: postgres
|
||||
restart: always
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
@@ -1,10 +1,5 @@
|
||||
FROM node:24.6.0-slim AS base
|
||||
|
||||
# Installing npm globally to ensure the latest version is used
|
||||
RUN npm install --location=global npm@latest
|
||||
|
||||
# Build stage
|
||||
FROM base AS builder
|
||||
FROM node:24.6.0 AS builder
|
||||
|
||||
# Setting working directory for build
|
||||
WORKDIR /app
|
||||
@@ -28,15 +23,21 @@ COPY . .
|
||||
RUN yarn run build
|
||||
|
||||
# Production stage
|
||||
FROM base
|
||||
FROM node:24.6.0-slim
|
||||
|
||||
# Setting working directory
|
||||
# Setting working directory for build
|
||||
WORKDIR /app
|
||||
|
||||
# Installing serve to run the production build
|
||||
RUN yarn global add serve
|
||||
|
||||
# Copying only the build output from the builder stage
|
||||
# Copying only the necessary files from the builder stage
|
||||
# This includes package.json, yarn.lock, tsconfig.json, node_modules, public, and the build output
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/yarn.lock ./
|
||||
COPY --from=builder /app/tsconfig.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/build ./build
|
||||
|
||||
# Exposing the port the app will run on
|
||||
|
||||
Reference in New Issue
Block a user