build(docker): add dockerfiles and configs for mysql, mongo, redis, rabbitmq

This commit is contained in:
pnoker
2023-06-06 23:36:17 +08:00
parent 0625bd336c
commit 9da8d2ca42
13 changed files with 2320 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM registry.cn-beijing.aliyuncs.com/dc3/mongo:5.0.5
MAINTAINER pnoker <pnokers.icloud.com>
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& mkdir -p /dc3-mongo/config/
WORKDIR /dc3-mongo
ENV CACHE_SIZE_GB 2
COPY ./iot-dc3.js ./config/
COPY ./launch.sh ./
RUN apt update \
&& apt install tofrodos \
&& apt clean \
&& fromdos ./launch.sh \
&& chmod +x ./launch.sh
EXPOSE 27017
CMD [ "/dc3-mongo/launch.sh"]
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
mongod &
while true; do
mongo /dc3-mongo/config/iot-dc3.js && break
sleep 5
done
mongod --shutdown && mongod --auth --bind_ip_all --storageEngine wiredTiger --wiredTigerCacheSizeGB ${CACHE_SIZE_GB} &
wait
+23
View File
@@ -0,0 +1,23 @@
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM registry.cn-beijing.aliyuncs.com/dc3/mysql:5.7
MAINTAINER pnoker <pnokers.icloud.com>
ENV MYSQL_ROOT_PASSWORD dc3
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
COPY ./iot-dc3.sql /docker-entrypoint-initdb.d
COPY ./iot-dc3-nacos.sql /docker-entrypoint-initdb.d
+23
View File
@@ -0,0 +1,23 @@
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM registry.cn-beijing.aliyuncs.com/dc3/rabbitmq:3.8-alpine
MAINTAINER pnoker <pnokers.icloud.com>
COPY ./rabbitmq.conf /etc/rabbitmq/rabbitmq.conf
COPY ./keys /data/rabbitmq/dc3/keys
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& rm -f /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf \
&& rabbitmq-plugins enable --offline rabbitmq_management rabbitmq_mqtt rabbitmq_stomp
+19
View File
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDHjCCAgYCCQDoNANpxnFQSjANBgkqhkiG9w0BAQsFADBRMQswCQYDVQQGEwJD
TjELMAkGA1UECAwCQkoxCzAJBgNVBAcMAkJKMQ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ecXitl5CnZJqDrRuj75CqxGVMrw4xc0ThSqJBWGjkvn9O
jnCQq3t29oSwVIip3uugOC00PjcOiA34JAJLVMYvsgHyd+E29KSsUcFSx+38K0W9
eS0jrfCRSp6Nzt1m7NFcP4pUiTlQFWZqMJiiJh2c9sa1/t32exPdfP8kNIZuxK9W
ZvXG1FRdtxjuLaFjfArp1C4uuj14ZTTBSk3s8mqiPnaL9nduLIVxsDlJDTN8+hC5
iRM1X1YM7Gk0Uvnlz/KtOJpWiiZh4qPl18LyLPBHi5eef0HLC+oc+MFMtnw2M+im
YoNOkuBe0nPbYvxvItyOoF8f0oLIiRVAEUYwkJ1T3+iv8G18qZpkqQnOsrRB7JW/
2R41S6mKlDldCA5b5c892+5ZSqRw/Ey5Dv/lMgsS9HdBEhCH++7YN+2npyPv1yg8
quKNDEeoeodNK04slF5zluJvsfi3yD5tSnpliBCCDBok57Drd4mmOAtM08JU5lSk
391Nl+Gmrp8dBA1KcS/ZpI//VWfDVVhe6aUF77dAeGl52pR34miMSVh3E4lI5hfN
O18gfmeYQbbP5PDdX70+ByxqS4VbfMsiEtJxscQcKfoxSaKpdNJwlw==
-----END RSA PRIVATE KEY-----
+52
View File
@@ -0,0 +1,52 @@
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
## Networking
listeners.tcp.default = 5672
## HTTP listener and embedded Web server settings.
management.tcp.port = 15672
## On first start RabbitMQ will create a vhost and a user. These
## config items control what gets created.
## Relevant doc guide: https://rabbitmq.com/access-control.html
##
default_vhost = dc3
default_user = dc3
default_pass = dc3
# =======================================
# MQTT section
# =======================================
## TCP listener settings.
mqtt.listeners.tcp.default = :::1883
## TLS listener settings
mqtt.listeners.ssl.default = 8883
ssl_options.password = dc3-server
ssl_options.cacertfile = /data/rabbitmq/dc3/keys/ca.crt
ssl_options.certfile = /data/rabbitmq/dc3/keys/server.crt
ssl_options.keyfile = /data/rabbitmq/dc3/keys/server.key
## Set the default user name and password used for anonymous connections (when client
## provides no credentials). Anonymous connections are highly discouraged!
mqtt.vhost = dc3
mqtt.default_user = dc3
mqtt.default_pass = dc3
mqtt.allow_anonymous = false
## Specify the exchange to which messages from MQTT clients are published.
mqtt.exchange = dc3.e.mqtt
+22
View File
@@ -0,0 +1,22 @@
#
# Copyright 2016-present Pnoker All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM registry.cn-beijing.aliyuncs.com/dc3/redis:6.2.6-alpine
MAINTAINER pnoker <pnokers.icloud.com>
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
COPY ./redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
File diff suppressed because it is too large Load Diff