test(docker): testing docker building

This commit is contained in:
2025-12-22 17:38:48 -06:00
parent a31b516538
commit 797c9ccdf4
4 changed files with 112 additions and 0 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
node_modules
dist
Dockerfile
docker-compose.yml

17
.versionrc.json Normal file
View File

@@ -0,0 +1,17 @@
{
"types": [
{ "type": "feat", "section": "🌟 Enhancements" },
{ "type": "fix", "section": "🐛 Bug fixes" },
{ "type": "chore", "hidden": false, "section": "📝 Chore" },
{ "type": "docs", "section": "📚 Documentation" },
{ "type": "style", "hidden": false },
{ "type": "refactor", "section": "🛠️ Code Refactor" },
{ "type": "perf", "hidden": false, "section": "🚀 Performance" },
{ "type": "test", "section": "📝 Testing Code" },
{ "type": "ci", "hidden": false, "section": "📈 Project changes" },
{ "type": "build", "hidden": false, "section": "📈 Project Builds" }
],
"commitUrlFormat": "https://git.tuffraid.net/cowch/lst/commits/{{hash}}",
"compareUrlFormat": "https://git.tuffraid.net/cowch/lst/compare/{{previousTag}}...{{currentTag}}",
"header": "# All Changes to LST can be found below.\n"
}

42
Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
FROM node:24-alpine AS deps
WORKDIR /app
COPY package.json ./
RUN ls -la /app
#RUN mkdir frontend
#RUN mkdir lstDocs
#RUN mkdir controller
#COPY frontend/package*.json ./frontend
#COPY lstDocs/package*.json ./lstDocs
#COPY controller/index.html ./controller
RUN npm install
#RUN npm run install:front
#RUN npm run install:docs
# Build the Next.js app
FROM node:24-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
#COPY --from=deps /app/frontend/node_modules ./frontend/node_modules
#COPY --from=deps /app/lstDocs/node_modules ./lstDocs/node_modules
#COPY --from=deps /app/controller/index.html ./controller/index.html
#COPY . ./
RUN npm run build:app
#RUN npm run build:front
#RUN npm run build:docs
# Final stage
FROM node:24-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
#COPY --from=builder /app/frontend/dist ./frontend/dist
#COPY --from=builder /app/lstDocs/build ./lstDocs/build
#COPY --from=deps /app/controller/index.html ./controller/index.html
ENV NODE_ENV=production
ENV RUNNING_IN_DOCKER=true
ENV PORT=3000
EXPOSE 3000
CMD ["node", "dist/index.js"]

49
docker-compose.yml Normal file
View File

@@ -0,0 +1,49 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: lst_app
ports:
#- "${VITE_PORT:-4200}:4200"
- "4000:4200"
environment:
- NODE_ENV=development
# - DATABASE_HOST=host.docker.internal
# - DATABASE_PORT=${DATABASE_PORT}
# - DATABASE_USER=${DATABASE_USER}
# - DATABASE_PASSWORD=${DATABASE_PASSWORD}
# - DATABASE_DB=${DATABASE_DB}
- PROD_SERVER=${PROD_SERVER}
- PROD_PLANT_TOKEN=${PROD_PLANT_TOKEN}
- PROD_USER=${PROD_USER}
- PROD_PASSWORD=${PROD_PASSWORD}
# - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
# - BETTER_AUTH_URL=${BETTER_AUTH_URL}
restart: unless-stopped
# for all host including prod servers, plc's, printers, or other de
extra_hosts:
- "${PROD_SERVER}:${PROD_IP}"
networks:
- default
- logisticsNetwork
- mlan1
networks:
logisticsNetwork:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: ${LOGISTICS_NETWORK}
gateway: ${LOGISTICS_GATEWAY}
mlan1:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: ${MLAN1_NETWORK}
gateway: ${MLAN1_GATEWAY}