-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (40 loc) · 1.51 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (40 loc) · 1.51 KB
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
# Dockerfile to run uRedis server.
FROM alpine:latest
# Install required packages, tzdata and python3.
RUN sed -i '2s/^# *//' /etc/apk/repositories
RUN apk update && apk add --no-cache tzdata python3
# Set timezone for container to UTC.
# The timezone does not really matter for uredis-server though.
ENV TZ=UTC
RUN date
# Expose port for clients.
EXPOSE 6379
# Test Python installed.
RUN python3 --version
# Create directory for uredis applications.
RUN mkdir -p /opt/uredis
WORKDIR /opt/uredis
VOLUME /opt/uredis
# Copy uredis-server PYZ to container.
COPY uredis-server.pyz ./
# Copy uredis-client PYZ to container.
COPY uredis-client.pyz ./
# Copy README to container.
COPY README.md ./
# Copy version.txt to container.
COPY version.txt ./
# Create executable wrapper for server.
RUN echo "#!/bin/sh" > /usr/local/bin/uredis-server
RUN echo "python3 /opt/uredis/uredis-server.pyz \$@" >> /usr/local/bin/uredis-server
RUN chmod +x /usr/local/bin/uredis-server
# Create executable wrapper for client.
RUN echo "#!/bin/sh" > /usr/local/bin/uredis-client
RUN echo "python3 /opt/uredis/uredis-client.pyz \$@" >> /usr/local/bin/uredis-client
RUN chmod +x /usr/local/bin/uredis-client
# Test uredis-server installed.
RUN uredis-server --version
# Test uredis-client installed.
RUN uredis-client --version
# Run uredis server, binding to 0.0.0.0, writing all changes to disk
# and limiting that DB file to a size of 15GB (15,000,000,000 bytes).
CMD [ "uredis-server", "--bind", "0.0.0.0", "--max-db", "15000000000", "--update-disk" ]