Skip to content

Commit 49bd51d

Browse files
committed
update old code
1 parent b0cd8f4 commit 49bd51d

File tree

10 files changed

+1694
-7021
lines changed

10 files changed

+1694
-7021
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.eslintrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
{
2+
"extends": ["airbnb", "prettier"],
23
"parser": "babel-eslint",
3-
"extends": "airbnb",
44
"plugins": [
55
"react",
66
"jsx-a11y",
7-
"import"
7+
"import",
8+
"jest"
89
],
910
"env": {
11+
"browser": true,
1012
"node": true,
1113
"jest": true,
14+
"worker": true,
15+
"serviceworker": true,
1216
"es6": true
17+
},
18+
"rules": {
19+
"no-underscore-dangle": ["error", {
20+
"allow": ["_id", "__filename", "__dirname"]
21+
}]
1322
}
1423
}

Dockerfile

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,10 @@
1-
# docker run -it node:8.12-alpine /bin/bash
2-
# ---- Base Node ----
3-
FROM node:10-alpine AS base
4-
# Preparing
1+
FROM node:14-alpine AS base
2+
RUN apk add --update bash && rm -rf /var/cache/apk/*
53
RUN mkdir -p /var/app && chown -R node /var/app
6-
# Set working directory
74
WORKDIR /var/app
8-
# Copy project file
9-
COPY package.json .
10-
COPY package-lock.json .
11-
12-
#
13-
# ---- Dependencies ----
14-
FROM base AS dependencies
15-
RUN apk add --update python build-base
16-
# install node packages
17-
RUN npm ci --only=prod --silent
18-
# copy production node_modules aside
19-
RUN cp -R node_modules prod_node_modules
20-
# install ALL node_modules, including 'devDependencies'
21-
RUN npm ci --silent
22-
# Run in production mode
23-
24-
#
25-
# ---- Test & Build ----
26-
# run linters, setup and tests
27-
FROM dependencies AS build
285
COPY . .
29-
# Setup environment variables
30-
RUN npm run build
31-
32-
#
33-
# ---- Release ----
34-
FROM base AS release
35-
RUN apk add --update bash && rm -rf /var/cache/apk/*
36-
# copy production node_modules
37-
COPY --from=dependencies /var/app/prod_node_modules ./node_modules
38-
COPY --from=build /var/app/build ./build
39-
# COPY --from=build /var/app/source ./source
40-
41-
# Setup environment variables
6+
RUN npm ci --only=prod --silent
427
ENV NODE_ENV=production
43-
# expose port and define CMD
44-
EXPOSE 4000
8+
EXPOSE 3000
9+
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://0.0.0.0:3000 || exit 1
4510
CMD npm run start

0 commit comments

Comments
 (0)