2022-01-08 12:49:25 +01:00
# Dockerfiles and Docker Compose Examples
2022-01-08 13:01:38 +01:00
[**Dockerfiles** ](https://docs.docker.com/engine/reference/builder/ ) are text documents that contain all commands a user
could call in a terminal to assemble an application image.
2022-01-08 14:53:54 +01:00
[**Docker Compose** ](https://docs.docker.com/compose/ ) uses [human-friendly YAML files ](https://docs.photoprism.app/developer-guide/technologies/yaml/ )
2022-01-08 13:01:38 +01:00
to configure all application services so you can easily start them with a single command.
2022-01-08 12:49:25 +01:00
## Why are we using Docker? ##
Containers are nothing new; [Solaris Zones ](https://en.wikipedia.org/wiki/Solaris_Containers ) have been around for
about 15 years, first released publicly in 2004. The chroot system call was introduced during
[development of Version 7 Unix in 1979 ](https://en.wikipedia.org/wiki/Chroot ). It is used ever since for hosting
applications exposed to the public Internet.
Modern Linux containers are an incremental improvement. A main advantage of Docker is that application images
can be easily made available to users via Internet. It provides a common standard across most operating
systems and devices, which saves our team a lot of time that we can then spend more effectively, for example,
providing support and developing one of the many features that users are waiting for.
Human-readable and versioned Dockerfiles as part of our public source code also help avoid surprises and
2022-01-08 13:01:38 +01:00
"works for me" moments by enabling us to have the exact same environment everywhere in [development ](develop/Dockerfile )
and [production ](photoprism/Dockerfile ).
2022-01-08 12:49:25 +01:00
Last but not least, virtually all file format parsers have vulnerabilities that just haven't been discovered yet.
This is a known risk that can affect you even if your computer is not directly connected to the Internet.
Running apps in a container with limited host access is an easy way to improve security without
compromising performance and usability.
2022-01-08 13:24:03 +01:00
## What about Virtual Machines? ##
2022-01-08 12:49:25 +01:00
A virtual machine running its own operating system provides more security, but typically has side effects
2022-01-08 13:24:03 +01:00
such as lower performance and more difficult handling. You can also run Docker in a VM to get the best of
2022-01-08 14:45:05 +01:00
both worlds. It's essentially what happens when you run dockerized applications on [virtual cloud servers ](https://docs.photoprism.app/getting-started/cloud/digitalocean/ )
and operating systems other than Linux.
2022-01-08 12:49:25 +01:00
2022-01-08 13:24:03 +01:00
## Alternatives ##
2022-01-08 12:49:25 +01:00
2022-01-08 13:24:03 +01:00
### Building From Source ###
You can build and install PhotoPrism from the publicly available [source code ](https://docs.photoprism.app/developer-guide/setup/ ):
2022-01-08 12:49:25 +01:00
```bash
git clone https://github.com/photoprism/photoprism.git
cd photoprism
make all install
```
Missing build dependencies must be installed manually as shown in our human-readable and versioned
[Dockerfile ](https://github.com/photoprism/photoprism/blob/develop/docker/develop/Dockerfile ). You often don't
need to use the exact same versions, so it's possible to replace packages with what is available in your environment.
2022-01-12 08:40:28 +01:00
Note we don't have the resources to provide private users with dependencies and [TensorFlow libraries ](https://dl.photoprism.app/tensorflow/ ) for their personal
2022-01-08 12:49:25 +01:00
environments. We therefore recommend learning Docker if your operating system supports it. Docker vastly simplifies
2022-01-08 13:24:03 +01:00
installation and upgrades. It saves our team a lot of time that we can then spend more effectively.
2022-01-08 14:50:39 +01:00
### Installation Packages ###
2022-01-13 13:40:28 +01:00
Developers are invited to [contribute by building and testing standalone packages ](https://docs.photoprism.app/developer-guide/ )
2022-01-13 13:44:34 +01:00
for Linux distributions and other operating systems. New versions are [released several times a month ](https://docs.photoprism.app/release-notes/ ), and testing
2022-01-13 13:40:28 +01:00
the long list of dependencies in multiple environments would [absorb much of our resources ](https://docs.photoprism.app/funding/ ).
2022-01-08 14:50:39 +01:00
### BSD Ports 😈 ###
An [unofficial port ](https://docs.photoprism.app/getting-started/freebsd/ ) is available for FreeBSD / FreeNAS users.