Skip to content

Commit

Permalink
Merge pull request #89 from funidata/devops
Browse files Browse the repository at this point in the history
Configuration updates to enable production use
  • Loading branch information
VoxBorealis authored Jul 20, 2023
2 parents 8185e09 + 5fb49fd commit 4a488bd
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 22 deletions.
26 changes: 12 additions & 14 deletions app/.sequelizerc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
const {
DATABASE_NAME,
DATABASE_USERNAME,
DATABASE_PASSWORD,
DATABASE_HOST,
} = process.env;
const { DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_HOST } = process.env;

const commonConfig = {
username: DATABASE_USERNAME,
password: DATABASE_PASSWORD,
database: DATABASE_NAME,
host: DATABASE_HOST,
dialect: "postgres",
};

module.exports = {
development: {
username: DATABASE_USERNAME,
password: DATABASE_PASSWORD,
database: DATABASE_NAME,
host: DATABASE_HOST,
dialect: 'postgres',
},
};
development: commonConfig,
production: commonConfig,
};
4 changes: 3 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Using alpine because GitHub artifact upload is very slow for big images...
FROM node:18.16-alpine

USER node

# Install dependencies.
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci

COPY . .

CMD npm start
CMD npm --offline start
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hybridilusmu",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"npm": ">=9.5.1",
"node": ">=18.16.0"
Expand Down Expand Up @@ -38,4 +38,4 @@
"nyc": "^15.1.0",
"prettier": "^2.8.8"
}
}
}
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- ./app/test:/usr/src/app/test
depends_on:
- db
command: npm start

db:
container_name: lusmu-db
Expand Down
1 change: 1 addition & 0 deletions docs/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
proseWrap: never
1 change: 1 addition & 0 deletions docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineUserConfig({
sidebar: [
"/introduction.md",
"/developing.md",
"/hosting.md",
"/tests.md",
"/releases.md",
],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Developing Hybridilusmu
# Developing

This document guides you through the development process of Hybridilusmu.

Expand Down
19 changes: 19 additions & 0 deletions docs/src/hosting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Hosting

## Services

Hybridilusmu uses PostgreSQL database for persistence. Currently we are developing on version 14.7 but any fairly recent version should work.

## Server Configuration

The environment variables below are required

| Name | Description |
| --- | --- |
| `SLACK_APP_TOKEN` | App-Level Token with the `connections:write` scope. Used to authenticate the WebSocket connection (found under _Basic Information > App-Level Tokens_). |
| `SLACK_BOT_TOKEN` | Bot User OAuth Token (found under _OAuth & Permissions_). |
| `SLACK_SIGNING_SECRET` | Signing Secret (found under _Basic Information > App Credentials_). |
| `DATABASE_USERNAME` | PostgreSQL username. |
| `DATABASE_PASSWORD` | PostgreSQL password. |
| `DATABASE_NAME` | PostgreSQL database name. |
| `DATABASE_HOST` | PostgreSQL hostname. |
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hybridilusmu-dev-env",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"npm": ">=9.5.1",
"node": ">=18.16.0"
Expand All @@ -22,4 +22,4 @@
"lint": "cd app && npm run lint"
},
"license": "MIT"
}
}

0 comments on commit 4a488bd

Please sign in to comment.