diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..b96b258e5 --- /dev/null +++ b/.env.example @@ -0,0 +1,22 @@ +# The device ID is the unique identifier for the device that runs Platypush. +# You should make sure that it's unique at least within your local network, +# as it is used to identify the device in the MQTT topics, on the HTTP API +# and on the published ZeroConf services. +PLATYPUSH_DEVICE_ID=platypush + +# Use an external Redis server for the message queue. By default, the Platypush +# container will run a Redis server on the same container. Also remove the +# `--start-redis` option from the `docker run` command if you want to use an +# external Redis server. +# PLATYPUSH_REDIS_HOST=localhost +# PLATYPUSH_REDIS_PORT=6379 + +# Custom location for the Platypush configuration file. +# PLATYPUSH_CONFIG=/etc/platypush/config.yaml + +# Custom location for the Platypush working directory. +# PLATYPUSH_WORKDIR=/var/lib/platypush + +# SQLAlchemy database URL. By default, the Platypush container will run on a +# SQLite database installed under /main.db. If you want +# PLATYPUSH_DB=sqlite:////var/lib/platypush/main.db diff --git a/.gitignore b/.gitignore index 381643fe6..58e694e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ coverage.xml Session.vim /jsconfig.json /package.json -/Dockerfile /docs/source/wiki /.skipci dump.rdb +.env diff --git a/Dockerfile b/Dockerfile new file mode 120000 index 000000000..1f21c8655 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +platypush/install/docker/alpine.Dockerfile \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..0603a81aa --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,47 @@ +services: + platypush: + container_name: platypush + restart: "always" + command: + - platypush + # Comment --start-redis if you want to run an external Redis service + # In such case you'll also have to ensure that the appropriate Redis + # variables are set in the .env file, or the Redis configuration is + # passed in the config.yaml, or use the --redis-host and --redis-port + # command-line options + - --start-redis + + # Custom list of host devices that should be accessible to the container - + # e.g. an Arduino, an ESP-compatible microcontroller, a joystick etc. + # devices: + # - /dev/ttyUSB0 + + # Uncomment if you need plugins that require access to low-level hardware + # (e.g. Bluetooth BLE or GPIO/SPI/I2C) if access to individual devices is + # not enough or isn't practical + # privileged: true + + build: + context: . + # Alpine base image + dockerfile: ./platypush/install/docker/alpine.Dockerfile + # Debian base image + # dockerfile: ./platypush/install/docker/debian.Dockerfile + # Ubuntu base image + # dockerfile: ./platypush/install/docker/ubuntu.Dockerfile + # Fedora base image + # dockerfile: ./platypush/install/docker/fedora.Dockerfile + + # Copy .env.example to .env and modify as needed + # env_file: + # - .env + + ports: + # Comment if you don't have the HTTP backend enable or you don't want to + # expose it + - "8008:8008" + + volumes: + - /path/to/your/config.yaml:/etc/platypush + - /path/to/a/workdir:/var/lib/platypush + # - /path/to/a/cachedir:/var/cache/platypush