Skip to content

Commit

Permalink
Changing docker settings to transpile locally
Browse files Browse the repository at this point in the history
  • Loading branch information
hgorges committed Aug 18, 2024
1 parent 3ef65b2 commit ea078c0
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 251 deletions.
24 changes: 0 additions & 24 deletions .dockerignore

This file was deleted.

12 changes: 8 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"root": true,
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": { "project": ["./tsconfig.json"] },
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/strict-boolean-expressions": [
Expand All @@ -27,9 +29,11 @@
"@typescript-eslint/no-explicit-any": "off"
},
"ignorePatterns": [
"src/**/*.test.ts",
"public/js/**/*.js",
"coverage/**/*.js",
"jest.config.ts"
"dist/**/*.js",
"public/js/**/*.js",
"jest.config.ts",
// Ignore test files
"test/*"
]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea/
coverage/
node_modules/
out/
dist/
secrets/
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"useTabs": false,
"overrides": [
{
"files": ["*.json", "*.yml"],
"files": ["*.json", "*.{yml,yaml}"],
"options": {
"tabWidth": 2
}
Expand Down
13 changes: 2 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ WORKDIR /app

COPY package*.json ./

RUN npm install && npm cache clean --force
RUN npm install

COPY tsconfig.json ./
COPY nodemon.json ./

COPY ./src ./src
COPY ./db ./db
COPY ./public ./public
COPY ./views ./views
COPY ./secrets ./secrets

RUN npm run build
CMD [ "npm", "start" ]
73 changes: 0 additions & 73 deletions db/data-model.drawio

This file was deleted.

29 changes: 14 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
version: '3.8'

services:
server:
image: daily-dash
restart: always
build:
context: .
dockerfile: Dockerfile
pull_policy: never
command: sh -c "npm run migrate && npm start"
ports:
- ${PORT}:443
- ${DEBUG_PORT}:${DEBUG_PORT}
volumes:
- ./src:/app/src
- ./dist:/app/dist
- ./nodemon.json:/app/nodemon.json
- ./public:/app/public
- ./views:/app/views
- ./secrets:/app/secrets
build:
context: .
dockerfile: Dockerfile
pull_policy: never
env_file: ./secrets/.env
depends_on:
db:
Expand All @@ -26,35 +25,35 @@ services:
db:
image: postgres:latest
restart: always
ports:
- ${DB_PORT}:5432
volumes:
- db-data:/var/lib/postgresql/data
env_file: ./secrets/.env
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- ${DB_PORT}:5432
healthcheck:
test: [ 'CMD', 'pg_isready', '-U', '$DB_USERNAME' ]
test: ['CMD', 'pg_isready', '-U', '$DB_USERNAME']
interval: 10s
timeout: 5s
retries: 5
env_file: ./secrets/.env

cache:
image: redis:latest
restart: always
ports:
- ${REDIS_PORT}:6379
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- cache-data:/data
env_file: ./secrets/.env
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
healthcheck:
test: [ 'CMD', 'redis-cli', '--raw', 'incr', 'ping' ]
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 10s
timeout: 5s
retries: 5
env_file: ./secrets/.env

volumes:
db-data:
Expand Down
7 changes: 4 additions & 3 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"watch": ["src"],
"ext": ".ts,.js",
"watch": ["dist"],
"ext": ".js",
"ignore": [],
"exec": "node -r ts-node/register --inspect=0.0.0.0:9229"
"exec": "node --inspect=0.0.0.0:9229 ./dist/server.js",
"legacyWatch": true
}
Loading

0 comments on commit ea078c0

Please sign in to comment.