refactorin docker files

This commit is contained in:
les
2019-09-25 14:38:16 +02:00
parent 803a217122
commit d2f08d3412
9 changed files with 24 additions and 46 deletions

View File

@@ -0,0 +1,3 @@
FROM node:latest
WORKDIR /
RUN yarn global add gancio

View File

@@ -0,0 +1,29 @@
version: '3'
services:
db:
image: postgres
container_name: postgres
volumes:
- db:/var/lib/postgres
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=gancio
- POSTGRES_DB=gancio
- POSTGRES_PASSWORD=gancio
restart: always
ports:
- 5432:5432
gancio:
build: .
image: node:latest
container_name: gancio
restart: always
command: gancio start --docker --db=postgresql
volumes:
- ./config.json:/opt/gancio/config.json
- ./uploads:/opt/gancio/uploads
depends_on:
- db
ports:
- "localhost:13120:13120"

View File

@@ -0,0 +1,17 @@
version: '3'
services:
gancio:
build: .
restart: always
image: node:latest
container_name: gancio
command: gancio start --docker --db=sqlite
environment:
- DEBUG
volumes:
- ./db.sqlite:/opt/gancio/db.sqlite
- ./config.json:/opt/gancio/config.json
- ./uploads:/opt/gancio/uploads
ports:
- "127.0.0.1:13120:13120"

View File

@@ -12,7 +12,7 @@ parent: Install
## Initial setup
**You do not need to clone the full repo as we distribute gancio via npm.**
A [Dockerfile](https://framagit.org/les/gancio/raw/docker/docker/Dockerfile) and a docker-compose.yml are the only files needed.
A Dockerfile and a docker-compose.yml are the only files needed.
- __Create a directory where everything related to gancio is stored (db, images, config)__
```bash
@@ -25,9 +25,8 @@ cd /opt/gancio
<div class='code-example bg-grey-lt-100' markdown="1">
1. **Download docker-compose.yml and Dockerfile**
```bash
wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.sqlite.yml \
-O docker-compose.yml
wget https://gancio.org/docker/Dockerfile
wget https://gancio.org/docker/sqlite/docker-compose.yml
```
1. Create an empty db and config (**this is needed**)
@@ -38,6 +37,7 @@ mkdir user_locale
1. Build docker image and launch interactive setup in one step
```
docker-compose build
docker-compose run --rm gancio gancio setup --docker --db=sqlite
```
</div>
@@ -47,9 +47,8 @@ docker-compose run --rm gancio gancio setup --docker --db=sqlite
1. **Download docker-compose.yml and Dockerfile**
```bash
wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml \
-O docker.compose.yml
wget https://gancio.org/docker/Dockerfile
wget https://gancio.org/docker/sqlite/docker-compose.yml
```
1. Create an empty configuration (**this is needed**)
@@ -60,6 +59,7 @@ mkdir user_locale
1. Build docker image and launch interactive setup in one step
```
docker-compose build
docker-compose run --rm gancio gancio setup --docker --db=postgresql
```
</div>