Skip to content
Snippets Groups Projects
Commit 9117a0fd authored by Benoît Courty's avatar Benoît Courty
Browse files

Better Docker integration

parent 73250f55
Branches
No related tags found
1 merge request!126Dockerization
......@@ -171,14 +171,4 @@ This is similar to: `./node_modules/.bin/jest --updateSnapshots`
# Use with Docker
Build with:
```shell
docker build . -t leximpact-client:local
```
Run with:
```shell
docker run -v $PWD:/opt/leximpact-client -p 9001:9001 leximpact-client:local
```
\ No newline at end of file
For Docker, see [docker/DOCKER.md](docker/DOCKER.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:
build: .
leximpact_client_only:
build:
context: .
dockerfile: ./docker/Dockerfile
networks:
- leximpact_net
ports:
- published: 9001
target: 9001
- 9080:9001
volumes:
- .:/opt/leximpact-client
networks:
leximpact_net:
name: leximpact_network
\ No newline at end of file
name: leximpact_client_only_network
\ 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
FROM node:12-alpine
WORKDIR /opt
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /opt/leximpact-client
# Copy sources from curent directory
#COPY . .
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment