70 lines
2.2 KiB
Docker
70 lines
2.2 KiB
Docker
# 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"
|