Unverified Commit 5bea0d0e authored by Emmanuel Raviart's avatar Emmanuel Raviart Committed by GitHub

Merge pull request #126 from leximpact/docker

Dockerization
parents 39877c99 f5881d88
# Created by https://www.gitignore.io/api/node,test,linux,macos,windows
# Edit at https://www.gitignore.io/?templates=node,test,linux,macos,windows
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
### Test ###
### Ignore all files that could be used to test your code and
### you wouldn't want to push
# Reference https://en.wikipedia.org/wiki/Metasyntactic_variable
# Most common
*foo
*bar
*fubar
*foobar
*baz
# Less common
*qux
*quux
*bongo
*bazola
*ztesch
# UK, Australia
*wibble
*wobble
*wubble
*flob
*blep
*blah
*boop
*beep
# Japanese
*hoge
*piyo
*fuga
*hogera
*hogehoge
# Portugal, Spain
*fulano
*sicrano
*beltrano
*mengano
*perengano
*zutano
# France, Italy, the Netherlands
*toto
*titi
*tata
*tutu
*pipppo
*pluto
*paperino
*aap
*noot
*mies
# Other names that would make sense
*testsdir
*testsfile
*testsfiles
*testdir
*testfile
*testfiles
*testing
*testingdir
*testingfile
*testingfiles
*temp
*tempdir
*tempfile
*tempfiles
*tmp
*tmpdir
*tmpfile
*tmpfiles
*lol
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/node,test,linux,macos,windows
### ----------------------------------------
###
### Custom LexImpact
###
### ----------------------------------------
report.*.json
# NextJS files
.next
build
PORT=9001
NODE_ENV=development
API_URL=https://api.leximpact.an.fr/
\ No newline at end of file
......@@ -168,3 +168,7 @@ npm run test --updateSnapshots
```
This is similar to: `./node_modules/.bin/jest --updateSnapshots`
# Use with Docker
For Docker, see [docker/README.md](docker/README.md).
\ No newline at end of file
# Client only, to use the local server, see the leximpact-server project.
version: '3.7'
services:
leximpact_client_only:
build:
context: .
dockerfile: ./docker/Dockerfile
networks:
- leximpact_net
ports:
- 9080:9001
volumes:
- .:/opt/leximpact-client
- /opt/leximpact-client/node_modules
networks:
leximpact_net:
name: leximpact_client_only_network
\ No newline at end of file
FROM node:12-alpine
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /opt/leximpact-client
COPY package.json .
# Install dependencies
RUN npm update
RUN npm install
# Copy everything
COPY . .
EXPOSE 9001
CMD ["npm", "run", "dev"]
#ENTRYPOINT ["watch", "-n", "60", "echo 'Client is in debug...'"]
\ No newline at end of file
# Utilisation de LexImpact Client avec Docker
Cette documentation ne concerne que l'exécution du client, en utilisant le server de production. Pour l'usage avec leximpact-server local, voir leximpact-server/docker/DOCKER.md.
## Pre-requis
Cloner le projet client dans un dossier et se rendre dans leximpact-client.
```sh
git clone https://github.com/leximpact/leximpact-client.git
cd leximpact-client
```
Préparer la configuration :
```sh
cp docker/docker-remote.env .env
```
Les paramètres par défaut fonctionnent, voir le README principale pour l'explication des paramètres.
## Lancement
```sh
docker-compose up
```
Ceci va exécuter :
- leximpact-client [http://localhost:9080](http://localhost:9080)
Arrêter avec ctrl+c
## Forcer le build
```sh
docker-compose up --build
```
## Nettoyage
Efface les conteneurs, les volumes et les images :
```sh
docker-compose down -v
docker image rm leximpact-client_leximpact_client_only
```
\ No newline at end of file
PORT=9001
NODE_ENV=development
# Accept external connection for Docker
HOST=0.0.0.0
API_URL=http://leximpact_server:5000
\ No newline at end of file
PORT=9001
NODE_ENV=development
# Accept external connection for Docker
HOST=0.0.0.0
# Use production API
API_URL=https://api.leximpact.an.fr/
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment