Merge pull request #2972 from bluewave-labs/fix/update-docker-files

fix/update docker files
This commit is contained in:
Alexander Holliday
2025-09-23 11:01:19 -07:00
committed by GitHub
8 changed files with 49 additions and 10 deletions

View File

@@ -5,11 +5,10 @@ cd "$(dirname "$0")"
cd ../..
# Define service names and their corresponding Dockerfiles in parallel arrays
services=("uptime_client" "uptime_mongo" "uptime_redis" "uptime_server")
services=("uptime_client" "uptime_mongo" "uptime_server")
dockerfiles=(
"./docker/dev/client.Dockerfile"
"./docker/dev/mongoDB.Dockerfile"
"./docker/dev/redis.Dockerfile"
"./docker/dev/server.Dockerfile"
)

View File

@@ -13,6 +13,8 @@ RUN npm install
COPY ./server/ ./
RUN npm run build
EXPOSE 52345
CMD ["node", "src/index.js"]
CMD ["node", "dist/index.js"]

View File

@@ -35,10 +35,12 @@ RUN npm install
COPY server ./
COPY --from=frontend-build /app/client/dist ./public
RUN chmod +x ./scripts/inject-vars.sh
RUN npm run build
COPY --from=frontend-build /app/client/dist ./public
EXPOSE 52345
CMD ["sh", "-c", "./scripts/inject-vars.sh && node ./src/index.js"]
CMD ["sh", "-c", "./scripts/inject-vars.sh && node ./dist/index.js"]

View File

@@ -0,0 +1,27 @@
services:
server:
image: mono_server
restart: always
ports:
- "52345:52345"
environment:
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
- UPTIME_APP_CLIENT_HOST=http://localhost
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
- CLIENT_HOST=http://localhost
- JWT_SECRET=my_secret
depends_on:
- mongodb
mongodb:
image: mono_mongo
restart: always
command: ["mongod", "--quiet", "--bind_ip_all"]
volumes:
- ./mongo/data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30

View File

@@ -19,12 +19,15 @@ WORKDIR /app/server
COPY server ./
COPY --from=frontend-build /app/client/dist ./public
RUN npm install
RUN npm run build
COPY --from=frontend-build /app/client/dist ./public
RUN chmod +x ./scripts/inject-vars.sh
EXPOSE 52345
CMD ./scripts/inject-vars.sh && node ./src/index.js
CMD ./scripts/inject-vars.sh && node ./dist/index.js

View File

@@ -13,6 +13,8 @@ RUN npm install
COPY ./server/ ./
RUN npm run build
EXPOSE 52345
CMD ["node", "src/index.js"]
CMD ["node", "dist/index.js"]

View File

@@ -15,6 +15,8 @@ RUN npm install
COPY ./server ./
RUN npm run build
EXPOSE 52345
CMD ["node", "src/index.js"]

View File

@@ -15,6 +15,8 @@ RUN npm install
COPY ./server ./
RUN npm run build
EXPOSE 52345
CMD ["node", "src/index.js"]
CMD ["node", "dist/index.js"]