This project provides a webservice with a REST-API for file-conversions using ffmpeg
, imageMagick
and unoconv
.
[[TOC]]
- FFmpeg needs to be installed on your local machine if you are not running the webservice in a docker. In order to get everything working read these documents as it requires a little more attention to configure everything properly:
- ffmpeg docs
- imageMagick docs
- unoconv docs
- Docker installation (required to build and run docker containers)
- Environment variables setup
You can either build this project from source or use a built docker image.
If the above mentioned requirements are met one can run the service using the command:
yarn run start
One can also build the webservice in a docker
container by using the following command:
# building the container image
yarn run build:docker
# running the container
yarn run start:docker
You can use the built image of teamparallax/conversion-service
by running the following command:
# Pull image from Dockerhub
docker pull teamparallax/conversion-service:<TAG>
# Run the image
docker run [--name <NAME>] -it -p <YOUR_PORT>:3000 teamparallax/conversion-service:<TAG>
# Pass env variables to container
docker run [--name <NAME>] -it -e <KEY>=<VALUE> -p <YOUR_PORT>:3000 teamparallax/conversion-service:<TAG>
# Pass variables with env-file
docker run [--name <NAME>] -it --env-file <PATH TO ENV-FILE> -p <YOUR_PORT>:3000 teamparallax/conversion-service:<TAG>
Navigate to the repository location on your system.
Ensure there is an available env
file named template.env
that contains all necessary values for the docker container.
For further information on environment-variables, see here
version: "3"
services:
conversion-service:
build:
context: .
dockerfile: ./Dockerfile
env_file: ./template.env
ports:
- 3000:3000
restart: always
Running docker-compose up
within the repository will start the container that runs the conversion-service
image.
To see the API-documentation in development-environment one can go to http://localhost:3000/docs
.