Compare commits
3 Commits
lab5-hiatu
...
master
Author | SHA1 | Date |
---|---|---|
|
d4b830096f | |
|
8ca9a1c385 | |
|
cbe236f220 |
|
@ -0,0 +1,69 @@
|
|||
# dotnet build environment
|
||||
FROM alpine:latest as dotnet
|
||||
WORKDIR /
|
||||
|
||||
RUN apk add dotnet8-sdk git
|
||||
RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
|
||||
WORKDIR /hiveemulator/src/CommunicationControl/
|
||||
RUN dotnet build DevOpsProject/DevOpsProject.CommunicationControl.API.csproj
|
||||
RUN dotnet build DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.csproj
|
||||
|
||||
|
||||
# nodejs build environment
|
||||
#FROM alpine:latest as nodejs
|
||||
#WORKDIR /
|
||||
|
||||
#RUN apk add git npm
|
||||
#RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
|
||||
#WORKDIR /hiveemulator/src/MapClient/
|
||||
#RUN npm install
|
||||
#RUN npm run build
|
||||
|
||||
|
||||
# production environment
|
||||
FROM alpine:latest
|
||||
WORKDIR /
|
||||
|
||||
#RUN apk add dotnet8-sdk redis openrc lighttpd npm
|
||||
#RUN apk add git dotnet8-sdk redis openrc npm
|
||||
#RUN apk add git aspnetcore8-runtime redis openrc npm
|
||||
RUN apk add aspnetcore8-runtime redis openrc npm
|
||||
|
||||
#RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
#COPY --from=nodejs /hiveemulator/ /hiveemulator/
|
||||
COPY --from=dotnet /hiveemulator/ /hiveemulator/
|
||||
#COPY --from=nodejs /hiveemulator/src/MapClient/dist/* /var/www/localhost/htdocs/
|
||||
|
||||
#RUN mkdir /hive-cc
|
||||
#COPY --from=0 /hiveemulator/src/CommunicationControl/DevOpsProject/* /hive-cc/
|
||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject/* /hiveemulator/src/CommunicationControl/DevOpsProject/
|
||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/* /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/
|
||||
|
||||
#RUN mkdir /hive-hm
|
||||
#COPY --from=0 /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/* /hive-hm/
|
||||
|
||||
WORKDIR /hiveemulator/src/MapClient/
|
||||
RUN npm install
|
||||
RUN sed -i 's/localhost/10\.1\.1\.2/' public/config.json
|
||||
|
||||
WORKDIR /
|
||||
COPY ./daemon-files/hive-cc /etc/init.d/hive-cc
|
||||
COPY ./daemon-files/hive-hm /etc/init.d/hive-hm
|
||||
COPY ./daemon-files/hive-map /etc/init.d/hive-map
|
||||
RUN chmod u+x /etc/init.d/hive-hm /etc/init.d/hive-cc /etc/init.d/hive-map
|
||||
|
||||
#RUN mkdir /etc/rulevels/{stage-redis,stage-cc,stage-hm,stage-map}
|
||||
|
||||
#RUN rc-update add redis default
|
||||
#RUN rc-update add hive-hm default
|
||||
#RUN rc-update add hive-cc default
|
||||
#RUN rc-update add hive-map default
|
||||
|
||||
CMD sh -c "openrc default ; \
|
||||
rc-service redis start ; \
|
||||
rc-service hive-cc start ; \
|
||||
rc-service hive-hm start ; \
|
||||
rc-service hive-map start ; \
|
||||
exec sh"
|
|
@ -0,0 +1,24 @@
|
|||
# dotnet build environment
|
||||
FROM alpine:latest as dotnet
|
||||
WORKDIR /
|
||||
|
||||
RUN apk add git
|
||||
RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
|
||||
RUN apk add dotnet8-sdk
|
||||
|
||||
WORKDIR /hiveemulator/src/CommunicationControl/
|
||||
RUN dotnet publish DevOpsProject/DevOpsProject.CommunicationControl.API.csproj
|
||||
|
||||
# production environment
|
||||
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 as prod
|
||||
FROM alpine:latest as prod
|
||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Release/net8.0/ /app/
|
||||
RUN apk add aspnetcore8-runtime
|
||||
RUN mkdir -p /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Release/net8.0/
|
||||
COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Release/net8.0/ /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Release/net8.0/
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Release/net8.0/
|
||||
ENTRYPOINT ["./DevOpsProject.CommunicationControl.API"]
|
|
@ -0,0 +1,23 @@
|
|||
# dotnet build environment
|
||||
FROM alpine:latest as dotnet
|
||||
WORKDIR /
|
||||
|
||||
RUN apk add git
|
||||
RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
|
||||
RUN apk add dotnet8-sdk
|
||||
|
||||
WORKDIR /hiveemulator/src/CommunicationControl/
|
||||
RUN dotnet publish DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.csproj
|
||||
|
||||
|
||||
# production environment
|
||||
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 as prod
|
||||
FROM alpine:latest as prod
|
||||
RUN apk add aspnetcore8-runtime
|
||||
RUN mkdir -p /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Release/net8.0/
|
||||
#COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Release/net8.0/ /app/
|
||||
COPY --from=dotnet /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Release/net8.0/ /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Release/net8.0/
|
||||
|
||||
WORKDIR /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Release/net8.0/
|
||||
ENTRYPOINT ["./DevOpsProject.HiveMind.API"]
|
|
@ -0,0 +1,22 @@
|
|||
# nodejs build environment
|
||||
FROM alpine:latest as nodejs
|
||||
WORKDIR /
|
||||
|
||||
RUN apk add git
|
||||
RUN git clone https://gitlab.com/kzotkin/hiveemulator
|
||||
|
||||
RUN apk add npm
|
||||
|
||||
WORKDIR /hiveemulator/src/MapClient/
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
RUN rm public/config.json
|
||||
|
||||
|
||||
# production environment
|
||||
FROM nginx:alpine
|
||||
COPY --from=nodejs /hiveemulator/src/MapClient/dist/ /usr/share/nginx/html/
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
|
@ -0,0 +1,14 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
command="./DevOpsProject.CommunicationControl.API"
|
||||
command_args=""
|
||||
pidfile="/run/hive-cc.pid"
|
||||
supervisor="supervise-daemon"
|
||||
|
||||
start_pre() {
|
||||
cd /hiveemulator/src/CommunicationControl/DevOpsProject/bin/Debug/net8.0/
|
||||
}
|
||||
|
||||
depend() {
|
||||
need redis
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
command="./DevOpsProject.HiveMind.API"
|
||||
command_args=""
|
||||
pidfile="/run/hive-hm.pid"
|
||||
supervisor="supervise-daemon"
|
||||
|
||||
start_pre() {
|
||||
cd /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/bin/Debug/net8.0/
|
||||
}
|
||||
|
||||
depend() {
|
||||
need hive-cc
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
command="npm"
|
||||
command_args="run dev"
|
||||
pidfile="/run/hive-map.pid"
|
||||
supervisor="supervise-daemon"
|
||||
|
||||
depend() {
|
||||
need hive-cc
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
cd /hiveemulator/src/MapClient/
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
services:
|
||||
redis:
|
||||
image: redis:7
|
||||
restart: always
|
||||
networks:
|
||||
- sys
|
||||
|
||||
cc:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-cc
|
||||
#image: registry.digitalocean.com/duke-listings/cc
|
||||
restart: always
|
||||
environment:
|
||||
Redis__ConnectionString: "redis:6379"
|
||||
ports:
|
||||
- 8080:8080
|
||||
networks:
|
||||
- sys
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
hm:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-hm
|
||||
#image: registry.digitalocean.com/duke-listings/hm
|
||||
restart: always
|
||||
environment:
|
||||
CommunicationConfiguration__CommunicationControlIP: "cc"
|
||||
networks:
|
||||
- sys
|
||||
depends_on:
|
||||
- cc
|
||||
|
||||
map:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-map
|
||||
#image: registry.digitalocean.com/duke-listings/map
|
||||
restart: always
|
||||
volumes:
|
||||
- ./map/config.json:/usr/share/nginx/html/config.json:ro
|
||||
ports:
|
||||
- 80:80
|
||||
networks:
|
||||
- sys
|
||||
|
||||
networks:
|
||||
sys:
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"API": "http://10.1.1.2:8080/api/v1/client"
|
||||
}
|
Loading…
Reference in New Issue