-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
121 lines (90 loc) · 3.5 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
FROM docker.io/ubuntu:22.04
LABEL maintainer="[email protected]"
ARG TZ=Europe/Helsinki
# Set home directory
RUN mkdir -p /home/root
WORKDIR /home/root
# Move help file to container
COPY ./files/help.txt .
###
# SETUP
###
# Set timezone
RUN ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
# Run updates in
RUN apt-get update && apt-get upgrade -y
# Variables
ENV apt apt-get --no-install-recommends install -yq
# Basic software to be installed
RUN $apt sudo systemctl nano curl gnupg2 acl unzip git unzip wget less vim lsb-release gpg
###
# INSTALLATION
###
# Install Python3
RUN $apt python3 python3-pip python3-setuptools
# Update pip
RUN python3 -m pip install --upgrade pip
# Install pip packages
RUN pip3 install mycli
#
# SQLITE3
#
# Install sqlite3
RUN $apt sqlite3
#
# MARIADB
#
# Install MariaDB
RUN $apt mariadb-server
# Start the MySQL (mariaDB) service
RUN echo "/sbin/service mariadb start" >> ~/.bashrc
#
# REDIS
#
# Install Redis
RUN curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
RUN apt-get update
RUN $apt redis
# Configure Redis to run in the background
RUN sed -i "s|daemonize yes|daemonize no|g" /etc/redis/redis.conf
#RUN sed -i "s|supervised no|supervised systemd|g" /etc/redis/redis.conf
# Expose Redis to be visible outside of the container
RUN sed -i "s|protected-mode yes|protected-mode no|g" /etc/redis/redis.conf
RUN sed -i "s|bind 127.0.0.1 -::1|#bind 127.0.0.1 -::1|g" /etc/redis/redis.conf
# Copy the Redis systemd file to container
COPY ./files/redis.service /etc/systemd/system/redis.service
# Enable and start the Redis service
RUN systemctl enable redis
RUN systemctl start redis
RUN echo "systemctl start redis" >> ~/.bashrc
# Install iredis
RUN pip install iredis
#
# MONGODB
#
# Mongodb version 7
#RUN curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
#RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
RUN apt update
RUN $apt mongodb-org
# Expose this instance to the whole world
# Absolutely NEVER do this in a production environment
RUN sed -i "s|127.0.0.1|0.0.0.0|g" /etc/mongod.conf
RUN echo "systemctl start mongod.service" >> ~/.bashrc
#RUN printf "cloud:\n monitoring:\n free:\n state: 'off'" >> /etc/mongod.conf
#
# NEO4J
#
RUN curl -fsSL https://debian.neo4j.com/neotechnology.gpg.key |sudo gpg --dearmor -o /usr/share/keyrings/neo4j.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/neo4j.gpg] https://debian.neo4j.com stable 5" | sudo tee -a /etc/apt/sources.list.d/neo4j.list
RUN apt update
RUN $apt neo4j
RUN sed -i "s|#server.default_listen_address=0.0.0.0|server.default_listen_address=0.0.0.0|g" /etc/neo4j/neo4j.conf
RUN echo "systemctl start neo4j.service" >> ~/.bashrc
# Create a directory for systemd to use
RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container
# Set the entrypoint to systemd
CMD ["/sbin/init"]