Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Update dependencies, fix some issues and migrate to TS #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
npm-debug.log
docker-compose.yml
Dockerfile
.dockerignore
.git
.gitignore
.travis.yml
README.md
dist
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
migrations
dist
.eslintrc.js
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/

dist/
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
31 changes: 22 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
FROM node:6
FROM node:12

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y git GraphicsMagick
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y \
git \
graphicsmagick

RUN mkdir -p /app/
WORKDIR /app/
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app

USER node

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
RUN npm install -g node-pg-migrate pg --silent

COPY package.json .
COPY --chown=node:node package*.json ./
RUN npm install

COPY . .
COPY --chown=node:node tsconfig.json ./
COPY --chown=node:node ./src ./src
RUN npm run tsc

COPY --chown=node:node ./migrations ./migrations

EXPOSE 3001
CMD npm run migrate up && npm test && npm start

CMD npm start
USER node
54 changes: 0 additions & 54 deletions app.js

This file was deleted.

14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ services:
POSTGRES_PASSWORD: bla
POSTGRES_DB: criticalmaps
ports:
- "5433:5432"
- "5432:5432"
restart: always

web:
build:
context: .
dockerfile: Dockerfile
ports:
- "80:80"
volumes:
- .:/usr/src/app
- "80:3001"
depends_on:
- db
links:
- db
environment:
NODE_ENV: production
DEBUG: "*"
DATABASE_URL: postgres://bla:bla@db:5433/criticalmaps
links:
- db
DATABASE_URL: postgres://bla:bla@db:5432/criticalmaps
restart: always
Loading