add Dockerfile for building the container
This commit is contained in:
parent
17ceed960e
commit
cbe236f220
|
@ -0,0 +1,63 @@
|
||||||
|
# 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"
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command="/usr/bin/dotnet"
|
||||||
|
command_args="run --project /hiveemulator/src/CommunicationControl/DevOpsProject/DevOpsProject.CommunicationControl.API.csproj"
|
||||||
|
pidfile="/run/hive-cc.pid"
|
||||||
|
supervisor="supervise-daemon"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need redis
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command="/usr/bin/dotnet"
|
||||||
|
command_args="run --project /hiveemulator/src/CommunicationControl/DevOpsProject.HiveMind.API/DevOpsProject.HiveMind.API.csproj"
|
||||||
|
pidfile="/run/hive-hm.pid"
|
||||||
|
supervisor="supervise-daemon"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need hive-cc
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command="npm"
|
||||||
|
command_args="run dev"
|
||||||
|
pidfile="/run/hive-map.pid"
|
||||||
|
supervisor="supervise-daemon"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need hive-cc
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
cd /hiveemulator/src/MapClient/
|
||||||
|
${command} ${command_args}
|
||||||
|
}
|
Loading…
Reference in New Issue