-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
149 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mailroom.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
FROM node:20 AS build | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN rm entrypoint.sh | ||
RUN npm i --omit=dev | ||
|
||
FROM node:20-alpine | ||
|
||
ENV INBOX_PORT="25" | ||
ENV INBOX_HOST="smtp.example.com" | ||
ENV INBOX_LOG_FILE="/tmp/inbox.log" | ||
ENV INBOX_TLS_MIN_VERSION="TLSv1.3" | ||
ENV INBOX_TLS_KEY_PATH="/certs/inbox/privkey.pem" | ||
ENV INBOX_TLS_CERT_PATH="/certs/inbox/cert.pem" | ||
ENV LOG_FILE="/var/log/inbox.log" | ||
ENV LOG_LEVEL="INFO" | ||
ENV INBOX_COINTAINER_TLS_KEY="/etc/ssl/inbox/privkey.pem" | ||
ENV INBOX_COINTAINER_TLS_CERT="/etc/ssl/inbox/cert.pem" | ||
ENV REDIS_HOST="redis_mail" | ||
ENV REDIS_PORT="6379" | ||
ENV REDIS_PORT=6379 | ||
ENV INBOX_MAX_CONNECTIONS=1024 | ||
ENV INBOX_PORT=25 | ||
|
||
RUN apk add openssl; adduser app -H -D | ||
RUN apk add openssl | ||
|
||
WORKDIR /usr/src/inbox | ||
|
||
COPY --from=build /app /usr/src/inbox | ||
COPY --chmod=500 --chown=1000 entrypoint.sh /entrypoint.sh | ||
EXPOSE $INBOX_PORT | ||
|
||
USER app | ||
|
||
ENTRYPOINT "node src/index.js 2>&1 | tee /tmp/inbox.log" | ||
USER 1000 | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["src/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
FROM node:20 AS build | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN rm entrypoint.sh | ||
RUN npm i --omit=dev | ||
|
||
FROM node:20-alpine | ||
|
||
ENV INBOX_PORT="25" | ||
ENV INBOX_HOST="smtp.example.com" | ||
ENV INBOX_LOG_FILE="/tmp/inbox.log" | ||
ENV INBOX_TLS_MIN_VERSION="TLSv1.3" | ||
ENV INBOX_TLS_KEY_PATH="/certs/inbox/privkey.pem" | ||
ENV INBOX_TLS_CERT_PATH="/certs/inbox/cert.pem" | ||
ENV LOG_FILE="/var/log/inbox.log" | ||
ENV LOG_LEVEL="INFO" | ||
ENV INBOX_COINTAINER_TLS_KEY="/etc/ssl/inbox/privkey.pem" | ||
Check warning on line 11 in inbox/Dockerfile.dev
|
||
ENV INBOX_COINTAINER_TLS_CERT="/etc/ssl/inbox/cert.pem" | ||
ENV REDIS_HOST="redis_mail" | ||
ENV REDIS_PORT="6379" | ||
ENV REDIS_PORT=6379 | ||
ENV INBOX_MAX_CONNECTIONS=1024 | ||
ENV INBOX_PORT=25 | ||
|
||
RUN apk add openssl; adduser app -H -D | ||
RUN apk add openssl | ||
|
||
WORKDIR /usr/src/inbox | ||
|
||
COPY --from=build /app /usr/src/inbox | ||
COPY --chmod=500 --chown=1000 entrypoint.sh /entrypoint.sh | ||
COPY ./smtp-server /usr/src/inbox/node_modules/@carlgo11/smtp-server | ||
|
||
USER app | ||
EXPOSE $INBOX_PORT | ||
|
||
ENTRYPOINT "node src/index.js 2>&1 | tee /tmp/inbox.log" | ||
USER 1000 | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["src/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
npm run test && | ||
node "$*" 2>&1 | tee "$LOG_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import fs from 'fs'; | ||
|
||
export const tlsConfig = { | ||
key: fs.readFileSync(process.env.INBOX_TLS_KEY_PATH || process.env.TLS_KEY_PATH), | ||
cert: fs.readFileSync(process.env.INBOX_TLS_CERT_PATH || process.env.TLS_CERT_PATH), | ||
key: fs.readFileSync(process.env.INBOX_COINTAINER_TLS_KEY), | ||
cert: fs.readFileSync(process.env.INBOX_COINTAINER_TLS_CERT), | ||
minVersion: process.env.INBOX_TLS_MIN_VERSION || process.env.TLS_MIN_VERSION, | ||
maxVersion: process.env.INBOX_TLS_MAX_VERSION || process.env.TLS_MAX_VERSION, | ||
ciphers: process.env.INBOX_TLS_CIPHERS || process.env.TLS_CIPHERS, | ||
handshakeTimeout: 5000, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.