make docker-compose.yml production ready
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
inventaire
|
inventaire
|
||||||
|
.env
|
||||||
data
|
data
|
||||||
log
|
log
|
||||||
configs/docker.ini
|
configs/docker.ini
|
||||||
|
|||||||
12
Dockerfile.inventaire
Executable file
12
Dockerfile.inventaire
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM node:20
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y curl zsh git graphicsmagick inotify-tools jq \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# Default to the same user as the host (override from command lin if needed)
|
||||||
|
# Known benefits:
|
||||||
|
# - allows to handle leveldb with level-party from both the host and container at the same time
|
||||||
|
USER 1000:1000
|
||||||
|
|
||||||
|
CMD ["npm", "run", "start"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Run [Inventaire](https://github.com/inventaire/inventaire) in Docker
|
Run [Inventaire](https://github.com/inventaire/inventaire) in Docker
|
||||||
|
|
||||||
This repository is meant to support running Inventaire for testing and development. For production, see [inventaire-deploy](https://github.com/inventaire/inventaire-deploy).
|
This repository is packaging Inventaire for Docker production environement. To run it for production outside Docker, see [inventaire-deploy](https://github.com/inventaire/inventaire-deploy).
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,36 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
|
inventaire:
|
||||||
|
build:
|
||||||
|
context: ./.
|
||||||
|
dockerfile: Dockerfile.inventaire
|
||||||
|
ports:
|
||||||
|
- "3006:3006"
|
||||||
|
volumes:
|
||||||
|
- ./inventaire:${PROJECT_ROOT}
|
||||||
|
working_dir: ${PROJECT_ROOT}
|
||||||
|
environment:
|
||||||
|
NODE_ENV: 'production'
|
||||||
|
COUCHDB_USER: ${COUCHDB_USER}
|
||||||
|
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
|
||||||
|
PUBLIC_HOSTNAME: ${PUBLIC_HOSTNAME}
|
||||||
|
depends_on:
|
||||||
|
- elasticsearch
|
||||||
|
tty: true
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: "10m"
|
||||||
|
max-file: "3"
|
||||||
couchdb:
|
couchdb:
|
||||||
image: couchdb:3.4.2
|
image: couchdb:3.4.2
|
||||||
ports:
|
ports:
|
||||||
- "5984:5984"
|
- "5984:5984"
|
||||||
environment:
|
|
||||||
COUCHDB_USER: "yourcouchdbusername"
|
|
||||||
COUCHDB_PASSWORD: "yourcouchdbpassword"
|
|
||||||
volumes:
|
volumes:
|
||||||
- 'couchdb:/opt/couchdb/data'
|
- 'couchdb:/opt/couchdb/data'
|
||||||
- './configs:/opt/couchdb/etc/local.d'
|
- './configs:/opt/couchdb/etc/local.d'
|
||||||
|
environment:
|
||||||
|
COUCHDB_USER: ${COUCHDB_USER}
|
||||||
|
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
|
||||||
tty: true
|
tty: true
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
image: elasticsearch:7.16.2
|
image: elasticsearch:7.16.2
|
||||||
@@ -18,11 +39,13 @@ services:
|
|||||||
- 'transport.host=127.0.0.1'
|
- 'transport.host=127.0.0.1'
|
||||||
# See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/docker.html
|
# See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/docker.html
|
||||||
- 'discovery.type=single-node'
|
- 'discovery.type=single-node'
|
||||||
|
# Limit memory usage to 1Go,
|
||||||
|
# See https://www.elastic.co/guide/en/elasticsearch/reference/current/advanced-configuration.html
|
||||||
- 'ES_JAVA_OPTS=-Xms1g -Xmx1g'
|
- 'ES_JAVA_OPTS=-Xms1g -Xmx1g'
|
||||||
volumes:
|
volumes:
|
||||||
- 'elasticsearch:/usr/share/elasticsearch/data'
|
- 'elasticsearch:/usr/share/elasticsearch/data'
|
||||||
ports :
|
ports :
|
||||||
- '127.0.0.1:9200:9200'
|
- '9200:9200'
|
||||||
volumes:
|
volumes:
|
||||||
couchdb:
|
couchdb:
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
|||||||
12
dotenv
Normal file
12
dotenv
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Your website domain name
|
||||||
|
PUBLIC_HOSTNAME=an-inventaire-site.org
|
||||||
|
|
||||||
|
# Root path within docker container
|
||||||
|
PROJECT_ROOT=/opt/inventaire
|
||||||
|
|
||||||
|
# Generic user, to modify only for good reason
|
||||||
|
COUCHDB_USER=couchdb
|
||||||
|
|
||||||
|
# Consider passwords with no less than 32 charracters, for example:
|
||||||
|
# cat /dev/urandom | tr -dc A-Za-z0-9-_ | head -c 32
|
||||||
|
COUCHDB_PASSWORD=your_password
|
||||||
Reference in New Issue
Block a user