64 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
		
		
			
		
	
	
			64 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
| 
								 | 
							
								# dotnet build environment
							 | 
						||
| 
								 | 
							
								#FROM alpine:latest
							 | 
						||
| 
								 | 
							
								#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 git clone https://gitlab.com/kzotkin/hiveemulator
							 | 
						||
| 
								 | 
							
								#COPY --from=nodejs /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/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#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
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								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"
							 |