1
Fork 0

Update docker-compose example

This commit is contained in:
viktorstrate 2020-02-21 22:49:19 +01:00
parent 9bee0432ae
commit bb8aff6019
2 changed files with 69 additions and 1 deletions

View File

@ -37,7 +37,7 @@ $ git clone https://github.com/viktorstrate/photoview
$ cd photoview
```
2. Duplicate `docker-compose.proxy-example.yml` and name the new file `docker-compose.yml`
2. Duplicate `docker-compose.example.yml` and name the new file `docker-compose.yml`
3. Edit `docker-compose.yml`, find the comments starting with `Change This:`, and change the values, to properly match your setup.
4. Start the server by running the following command, inside the `photoview` directory

View File

@ -0,0 +1,68 @@
version: "3"
services:
db:
image: mariadb
restart: always
environment:
- MYSQL_DATABASE=photoview
- MYSQL_USER=photoview
- MYSQL_PASSWORD=photo-secret
- MYSQL_RANDOM_ROOT_PASSWORD=1
volumes:
- db_data:/var/lib/mysql
api:
build: ./api
restart: always
expose:
- 80
depends_on:
- db
environment:
- MYSQL_URL=photoview:photo-secret@tcp(db)/photoview
- PHOTO_CACHE=/app/cache
# Change This: The publicly exposed url for the api
# For example if the server is available from the domain example.com,
# change this value to http://example.com/api
- API_ENDPOINT=http://localhost:8080/api
- PUBLIC_ENDPOINT=http://localhost:8080/
- API_LISTEN_PORT=80
volumes:
# Change This: Link photo paths from the host machine
# Change this to the directory where your photos are located on your server.
# If the photos are located at `/home/user/photos`, then change this value
# to the following: `/home/user/photos:/photos:ro`.
# You can mount multiple paths, if your photos are spread across multiple directories.
- ./photos_path:/photos:ro
- api_cache:/app/cache
ui:
build:
context: ./ui
args:
# Change This: The publicly exposed url for the graphql api
# For example if the server is available from the domain example.com,
# change this value to http://example.com/api/graphql
GRAPHQL_ENDPOINT: http://localhost:8080/api/graphql
restart: always
expose:
- 80
depends_on:
- api
proxy:
image: nginx
restart: always
volumes:
- ./docker/nginx-proxy/default.conf:/etc/nginx/conf.d/default.conf
ports:
# Change This: Replace 8080 with the port you want photoview to be accessible at
- 8080:80
depends_on:
- api
- ui
volumes:
db_data:
api_cache: