Skip to content

Commit 7067a88

Browse files
committed
Initial commit
0 parents commit 7067a88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+11753
-0
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git/
2+
.webpack_cache/
3+
frontend/node_modules/
4+
backend/node_modules/
5+
public/
6+
7+
.dockerignore
8+
.env*
9+
!.env.example
10+
docker-compose.override.yml

.env.example

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Default values are optimized for production to avoid having to configure
2+
# much in production.
3+
#
4+
# However it should be easy to get going in development too. If you see an
5+
# uncommented option that means it's either mandatory to set it or it's being
6+
# overwritten in development to make your life easier.
7+
8+
# Rather than use the directory name, let's control the name of the project.
9+
export COMPOSE_PROJECT_NAME=hellonode
10+
11+
# You should generate a random string of 64+ characters for this value in prod.
12+
# You can generate secure secrets by running: ./run secret
13+
export SECRET_KEY=insecure_key_for_dev
14+
15+
# Which environment is running? This should be "development" or "production".
16+
#export NODE_ENV=production
17+
export NODE_ENV=development
18+
19+
# The bind port for the node server.
20+
#
21+
# Be warned that if you change this value you'll need to change 8000 in both
22+
# your Dockerfile and in a few spots in docker-compose.yml due to the nature of
23+
# how this value can be set (Docker Compose doesn't support nested ENV vars).
24+
#export PORT=8000
25+
26+
# Should the Webpack watcher use polling? Not all Docker hosts support inotify.
27+
# If you find your assets aren't updating in development then set this to true.
28+
#export WEBPACK_WATCHER_POLL=false
29+
30+
# You'll always want to set the POSTGRES_USER and POSTGRES_PASSWORD since the
31+
# postgres Docker image uses them for its default database user and password.
32+
export POSTGRES_USER=hello
33+
export POSTGRES_PASSWORD=password
34+
#export POSTGRES_HOST=postgres
35+
#export POSTGRES_PORT=5432
36+
#export POSTGRES_DB=hello
37+
38+
# Connection string to Redis. This will be used to connect directly to Redis
39+
# and for sessions. You can always split your Redis servers up later if needed.
40+
#export REDIS_URL=redis://redis:6379/0
41+
42+
# Should Docker restart your containers if they go down in unexpected ways?
43+
#export DOCKER_RESTART_POLICY=unless-stopped
44+
export DOCKER_RESTART_POLICY=no
45+
46+
# What healthcheck test command do you want to run? In development, having it
47+
# curl your web server will result in a lot of log spam, so setting it to
48+
# /bin/true is an easy way to make the healthcheck do basically nothing.
49+
#export DOCKER_WEB_HEALTHCHECK_TEST=curl localhost:8000/up
50+
export DOCKER_WEB_HEALTHCHECK_TEST=/bin/true
51+
52+
# What ip:port should be published back to the Docker host for the app server?
53+
# If you're using Docker Toolbox or a custom VM you can't use 127.0.0.1. This
54+
# is being overwritten in dev to be compatible with more dev environments.
55+
#
56+
# If you have a port conflict because something else is using 8000 then you
57+
# can either stop that process or change this 8000 to be something else.
58+
#
59+
# Use the default in production to avoid having gunicorn directly accessible to
60+
# the internet since it'll very likely be behind nginx or a load balancer.
61+
#export DOCKER_WEB_PORT_FORWARD=127.0.0.1:8000
62+
export DOCKER_WEB_PORT_FORWARD=8000
63+
64+
# What volume path should be used? In development we want to volume mount
65+
# everything so we can develop our code without rebuilding our Docker images.
66+
#export DOCKER_WEB_VOLUME=./public:/app/public
67+
export DOCKER_WEB_VOLUME=.:/app
68+
69+
# What CPU and memory constraints will be added to your services? When left at
70+
# 0, they will happily use as much as needed.
71+
#export DOCKER_POSTGRES_CPUS=0
72+
#export DOCKER_POSTGRES_MEMORY=0
73+
#export DOCKER_REDIS_CPUS=0
74+
#export DOCKER_REDIS_MEMORY=0
75+
#export DOCKER_WEB_CPUS=0
76+
#export DOCKER_WEB_MEMORY=0

.github/docs/screenshot.jpg

90.2 KB
Loading

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
push:
8+
branches:
9+
- "main"
10+
- "master"
11+
12+
jobs:
13+
test:
14+
runs-on: "ubuntu-20.04"
15+
16+
steps:
17+
- uses: "actions/checkout@v2"
18+
19+
- name: "Install CI dependencies"
20+
run: |
21+
./run ci:install-deps
22+
23+
- name: "Test"
24+
run: |
25+
# Remove volumes in CI to avoid permission errors due to UID / GID.
26+
sed -i "s|.:/app|/tmp:/tmp|g" .env*
27+
sed -i "s|.:/app|/tmp:/tmp|g" docker-compose.override.yml.example
28+
29+
./run ci:test
30+
env:
31+
DOCKER_BUILDKIT: "1"

.gitignore

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# Mostly created by https://www.gitignore.io
2+
3+
4+
### App #######################################################################
5+
6+
.webpack_cache/
7+
public/*
8+
!public/.keep
9+
10+
.env*
11+
!.env.example
12+
docker-compose.override.yml
13+
14+
15+
### Node ######################################################################
16+
17+
# Dependency directories
18+
frontend/node_modules/
19+
backend/node_modules/
20+
21+
# Logs
22+
logs
23+
*.log
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
lerna-debug.log*
28+
29+
# Diagnostic reports (https://nodejs.org/api/report.html)
30+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
31+
32+
# Directory for instrumented libs generated by jscoverage/JSCover
33+
lib-cov
34+
35+
# Coverage directory used by tools like istanbul
36+
coverage
37+
*.lcov
38+
39+
# nyc test coverage
40+
.nyc_output
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
.parcel-cache
78+
79+
# Next.js build output
80+
.next
81+
82+
# Nuxt.js build / generate output
83+
.nuxt
84+
dist
85+
86+
# vuepress build output
87+
.vuepress/dist
88+
89+
90+
### OSX #######################################################################
91+
92+
# General
93+
.DS_Store
94+
.AppleDouble
95+
.LSOverride
96+
97+
# Icon must end with two \r
98+
Icon
99+
100+
101+
# Thumbnails
102+
._*
103+
104+
# Files that might appear in the root of a volume
105+
.DocumentRevisions-V100
106+
.fseventsd
107+
.Spotlight-V100
108+
.TemporaryItems
109+
.Trashes
110+
.VolumeIcon.icns
111+
.com.apple.timemachine.donotpresent
112+
113+
# Directories potentially created on remote AFP share
114+
.AppleDB
115+
.AppleDesktop
116+
Network Trash Folder
117+
Temporary Items
118+
.apdisk
119+
120+
121+
### Vim #######################################################################
122+
123+
# Swap
124+
[._]*.s[a-v][a-z]
125+
!*.svg # comment out if you don't need vector files
126+
[._]*.sw[a-p]
127+
[._]s[a-rt-v][a-z]
128+
[._]ss[a-gi-z]
129+
[._]sw[a-p]
130+
131+
# Session
132+
Session.vim
133+
Sessionx.vim
134+
135+
# Temporary
136+
.netrwhist
137+
# Auto-generated tag files
138+
tags
139+
# Persistent undo
140+
[._]*.un~
141+
142+
143+
### VSCode ####################################################################
144+
145+
.vscode/*
146+
!.vscode/settings.json
147+
!.vscode/tasks.json
148+
!.vscode/launch.json
149+
!.vscode/extensions.json
150+
*.code-workspace
151+
152+
153+
### Emacs #####################################################################
154+
155+
# -*- mode: gitignore; -*-
156+
*~
157+
\#*\#
158+
/.emacs.desktop
159+
/.emacs.desktop.lock
160+
*.elc
161+
auto-save-list
162+
tramp
163+
.\#*
164+
165+
# Org-mode
166+
.org-id-locations
167+
*_archive
168+
169+
# flymake-mode
170+
*_flymake.*
171+
172+
# eshell files
173+
/eshell/history
174+
/eshell/lastdir
175+
176+
# elpa packages
177+
/elpa/
178+
179+
# reftex files
180+
*.rel
181+
182+
# AUCTeX auto folder
183+
/auto/
184+
185+
# cask packages
186+
.cask/
187+
dist/
188+
189+
# Flycheck
190+
flycheck_*.el
191+
192+
# server auth directory
193+
/server/
194+
195+
# projectiles files
196+
.projectile
197+
198+
# directory configuration
199+
.dir-locals.el
200+
201+
# network security
202+
/network-security.data

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a
6+
Changelog](https://keepachangelog.com/en/1.0.0/).
7+
8+
## [Unreleased]
9+
10+
- Nothing yet!
11+
12+
## [0.1.0] - 2021-03-11
13+
14+
### Added
15+
16+
- Everything!
17+
18+
[0.1.0]: https://github.com/nickjj/docker-node-example/releases/tag/0.1.0

0 commit comments

Comments
 (0)