Add docker images and compose for dist

This commit is contained in:
Alex Holliday committed 2024-09-30 12:24:53 +08:00
1 parent 9a33dffa50
commit bc85062dd1
9 files changed
+105 -135

No files matched your search

Vendored Executable
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# Change directory to root Server directory for correct Docker Context
cd ../..
#Client
client="./Docker/dist/client.Dockerfile"
# MongoDB
mongoDB="./Docker/dist/mongoDB.Dockerfile"
# Redis
redis="./Docker/dist/redis.Dockerfile"
# Server
server="./Docker/dist/server.Dockerfile"
docker build -f $client -t dist_uptime_client .
docker build -f $mongoDB -t dist_uptime_database_mongo .
docker build -f $redis -t dist_uptime_redis .
docker build -f $server -t dist_uptime_server .
echo "All images built"
+19
View File
@@ -0,0 +1,19 @@
FROM node:20-alpine as build
WORKDIR /app
COPY ./Client/package*.json ./
RUN npm install
COPY ./Client .
RUN npm run build
FROM nginx:1.27.1-alpine
COPY ./Docker/nginx/conf.d/dist_default.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
+31
View File
@@ -0,0 +1,31 @@
services:
client:
image: bluewaveuptime/uptime_client:test
ports:
- "80:80"
- "443:443"
depends_on:
- server
server:
image: bluewaveuptime/uptime_server:test
ports:
- "5000:5000"
depends_on:
- redis
- mongodb
environment:
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
- REDIS_HOST=redis
redis:
image: bluewaveuptime/uptime_redis:latest
ports:
- "6379:6379"
volumes:
- ./redis/data:/data
mongodb:
image: bluewaveuptime/uptime_database_mongo:latest
volumes:
- ./mongo/data:/data/db
command: ["mongod", "--quiet"]
ports:
- "27017:27017"
+3
View File
@@ -0,0 +1,3 @@
FROM mongo
EXPOSE 27017
CMD ["mongod"]
+2
View File
@@ -0,0 +1,2 @@
FROM redis
EXPOSE 6379
+13
View File
@@ -0,0 +1,13 @@
FROM node:20-alpine
WORKDIR /app
COPY ./Server/package*.json ./
RUN npm install
COPY ./Server/ ./
EXPOSE 5000
CMD ["node", "index.js"]