forked from tiredofit/docker-postal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (57 loc) · 1.79 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
FROM docker.io/tiredofit/alpine:3.19
ARG POSTAL_VERSION="main"
ARG POSTAL_COMMIT="da90e75"
LABEL maintainer="Sibren van Setten (github.com/siebsie23)"
LABEL commit="$POSTAL_COMMIT"
ENV POSTAL_CONFIG_FILE_PATH=/app/config/postal.yml \
CONTAINER_ENABLE_MESSAGING=FALSE \
RAILS_ENVIRONMENT=production
RUN set -x && \
addgroup -g 2525 postal && \
adduser -S -D -G postal -u 2525 -h /app/ postal && \
\
apk update && \
apk upgrade && \
apk add --virtual .postal-build-deps \
build-base \
git \
mariadb-dev \
ruby-dev \
&& \
\
apk add --virtual .postal-run-deps \
expect \
fail2ban \
gawk \
mariadb-client \
mariadb-connector-c \
openssl \
nodejs \
ruby \
ruby-bigdecimal \
ruby-etc \
ruby-io-console \
&& \
\
gem install bundler -v 2.5.6 --no-doc && \
\
### Fetch Source and install Ruby Dependencies
git clone --depth 1 --branch $POSTAL_VERSION https://github.com/postalserver/postal /app/ && \
cd /app && \
bundle install -j "$(nproc)" && \
git config --global --add safe.directory /app && \
if [ $POSTAL_VERSION = "main" ] ; then git rev-parse --short HEAD > /app/VERSION ; else echo $POSTAL_VERSION > /app/VERSION ; fi && \
chown -R postal /app/ && \
\
# Cleanup
rm -rf /app/docker-compose.yml /app/Dockerfile /app/Makefile && \
rm -rf /app/log && \
rm -rf /root/.bundle /root/.gem && \
cd /etc/fail2ban && \
rm -rf fail2ban.conf fail2ban.d jail.conf jail.d paths-*.conf && \
apk del .postal-build-deps && \
rm -rf /tmp/* /var/cache/apk/*
### Networking Setup
EXPOSE 25 5000
### Add Files and Assets
ADD install /