feat: let's encrypt

This commit is contained in:
NGPixel
2020-01-11 22:33:19 -05:00
parent 73da73a595
commit c6933a2d20
13 changed files with 459 additions and 160 deletions

View File

@@ -29,6 +29,7 @@ LABEL maintainer="requarks.io"
RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
mkdir -p /wiki && \
mkdir -p /logs && \
mkdir -p /wiki/data/content && \
chown -R node:node /wiki /logs
WORKDIR /wiki
@@ -44,8 +45,11 @@ COPY --chown=node:node ./LICENSE ./LICENSE
USER node
EXPOSE 3000
VOLUME ["/wiki/data/content"]
# HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost/healthz
EXPOSE 3000
EXPOSE 3443
# HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost:3000/healthz
CMD ["node", "server"]

View File

@@ -9,5 +9,10 @@ db:
db: $(DB_NAME)
storage: $(DB_FILEPATH)
ssl: $(DB_SSL)
trustProxy: $(TRUST_PROXY)
ssl:
enabled: $(SSL_ACTIVE)
port: 3443
provider: letsencrypt
domain: $(LETSENCRYPT_DOMAIN)
maintainerEmail: $(LETSENCRYPT_EMAIL)
logLevel: info

View File

@@ -27,6 +27,7 @@ services:
restart: unless-stopped
ports:
- "80:3000"
- "443:3443"
volumes:
db-data:

View File

@@ -67,8 +67,8 @@ const init = {
console.warn(chalk.yellow('--- Closing DB connections...'))
await global.WIKI.models.knex.destroy()
console.warn(chalk.yellow('--- Closing Server connections...'))
if (global.WIKI.server) {
await new Promise((resolve, reject) => global.WIKI.server.destroy(resolve))
if (global.WIKI.servers) {
await global.WIKI.servers.stopServers()
}
console.warn(chalk.yellow('--- Purging node modules cache...'))