Skip to content

Commit

Permalink
initial commit, project generated with yo from template
Browse files Browse the repository at this point in the history
  • Loading branch information
gearoffortune committed Sep 30, 2019
0 parents commit ab993c2
Show file tree
Hide file tree
Showing 29 changed files with 21,007 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Atom Mail 2019 Alex Karetnikov

13 changes: 13 additions & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.6'
services:
frontend:
build:
context: .
dockerfile: ./docker/frontend/dockerfile-prod
volumes:
- ./.caddy:/root/.caddy # to save certificates on disk
- ./docker/frontend/Caddyfile:/etc/Caddyfile # to mount custom Caddyfile
ports:
- "2015:2015"
- "80:80"
- "443:443"
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Default compose file for development.
# Should be used directly in development.

version: "3.6"
services:
frontend:
build:
context: .
dockerfile: ./docker/frontend/Dockerfile
args:
NODE_ENV: "development"
command: npm start
volumes:
- .:/code
- /code/node_modules
ports:
- "3000:3000"
networks:
- webnet
environment:
HOST: "0.0.0.0"

networks:
webnet:
19 changes: 19 additions & 0 deletions docker/frontend/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
0.0.0.0:80
root /www
header / {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'"
}

gzip {
level 9
}

log stdout
errors stdout
41 changes: 41 additions & 0 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM node:alpine

ARG NODE_ENV
ENV NODE_ENV "$NODE_ENV"

# System deps:

RUN npm --version && apk add --no-cache \
autoconf \
automake \
bash \
build-base \
ca-certificates \
curl \
file \
g++ \
gcc \
git \
lcms2-dev \
libjpeg-turbo-dev \
libpng-dev \
make \
nasm \
wget \
zlib-dev


# Installing dependencies:
WORKDIR /code
COPY package.json package-lock.json /code/

# We do not need to tweak this command, `$NODE_ENV` does it for us.
RUN npm install


# Creating folders, and files for a project:
COPY . /code


# Project initialization:
EXPOSE 4000
12 changes: 12 additions & 0 deletions docker/frontend/dockerfile-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from node:alpine as build-stage

WORKDIR /app

COPY package.json package* ./
RUN npm i
COPY . ./
RUN npm run build

from abiosoft/caddy
COPY --from=build-stage /app/build /www
COPY docker/frontend/Caddyfile /etc/Caddyfile
41 changes: 41 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Configuring Jest
// See: https://facebook.github.io/jest/docs/en/configuration.html

module.exports = {
// without this line rootDir will be `./tests`
// 'rootDir': '..',

'moduleFileExtensions': [
'js',
'jsx',
'json',
],
'transform': {
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg|svg\\?inline)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
'moduleNameMapper': {
'^~/(.*)$': '<rootDir>/client/$1',
'^@/(.*)$': '<rootDir>/tests/$1',
},
'testPathIgnorePatterns': [
'/node_modules/',
'/docker/',
],

'collectCoverage': true,
'coverageThreshold': {
'global': {
'branches': 40,
'functions': 40,
'lines': 40,
'statements': 50
},
},
'coveragePathIgnorePatterns': [
'/node_modules/',
'/tests/',
],
'verbose': true,
}
Loading

0 comments on commit ab993c2

Please sign in to comment.