Project uses Visual Studio Code devcontainers for creating platform independent isolated development environment.
Check that these requirements are installed before proceeding futher
Other project requirements and VSCode extensions are managed by devcontainer system.
.devcontainer/docker-compose.yml
file. Pay attention to UID
and GID
variablesctrl+shift+b
to start dev serverProject is migrated back from yarn to npm. Please use npm for installing dependencies as production Dockerfile uses package-lock.json
file for dependency installation.
Development server supports livereload for detecting frontend changes
( Assuming that you have mysql (maridb) installed )
mysql nappikauppa2 < db/tables.sql
)DO NOT USE DEVELOPEMENT DOCKER DATABASE IN PRODUCTION Development docker database file is not for production use, if you want to run database inside docker, please create own image for that purposes.
docker build -t teekkarispeksi/nappikauppa2:latest .
and wait magic to happenBuild results to single alpine based docker image which is ready for execution.
We use portainer on top of docker swarm for running application stack in production.
Sample swarm stack configuration
version: '3.7'
services:
nappikauppa:
image: teekkarispeksi/nappikauppa2:latest
configs:
- source: nappikauppa-config
target: /app/config/config.js
- source: nappikauppa-frontend-config
target: /app/config/frontend-config.js
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 5s
order: start-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
configs:
nappikauppa-config:
name: nappikauppa2.config.v1.js
external: true
nappikauppa-frontend-config:
name: nappikauppa2.frontend-config.v1.js
external: true