2021-01-17 15:59:08 +01:00
|
|
|
### Build UI ###
|
2024-06-28 09:10:18 +02:00
|
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:18 AS ui
|
|
|
|
|
|
|
|
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
2020-03-01 02:06:18 +01:00
|
|
|
|
2021-07-15 17:43:07 +02:00
|
|
|
ARG REACT_APP_API_ENDPOINT
|
|
|
|
ENV REACT_APP_API_ENDPOINT=${REACT_APP_API_ENDPOINT}
|
2020-03-01 02:06:18 +01:00
|
|
|
|
2020-04-30 14:36:55 +02:00
|
|
|
# Set environment variable UI_PUBLIC_URL from build args, uses "/" as default
|
2020-04-15 21:16:36 +02:00
|
|
|
ARG UI_PUBLIC_URL
|
2020-04-30 14:36:55 +02:00
|
|
|
ENV UI_PUBLIC_URL=${UI_PUBLIC_URL:-/}
|
2020-04-15 21:16:36 +02:00
|
|
|
|
2021-04-20 15:58:22 +02:00
|
|
|
ARG VERSION
|
|
|
|
ENV VERSION=${VERSION:-undefined}
|
2021-08-30 12:22:12 +02:00
|
|
|
ENV REACT_APP_BUILD_VERSION=${VERSION:-undefined}
|
2021-04-20 15:58:22 +02:00
|
|
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ENV BUILD_DATE=${BUILD_DATE:-undefined}
|
2021-07-15 17:43:07 +02:00
|
|
|
ENV REACT_APP_BUILD_DATE=${BUILD_DATE:-undefined}
|
2021-04-20 15:58:22 +02:00
|
|
|
|
2021-04-20 18:14:52 +02:00
|
|
|
ARG COMMIT_SHA
|
|
|
|
ENV COMMIT_SHA=${COMMIT_SHA:-}
|
2021-08-30 12:22:12 +02:00
|
|
|
ENV REACT_APP_BUILD_COMMIT_SHA=${COMMIT_SHA:-}
|
2021-04-20 18:14:52 +02:00
|
|
|
|
2020-05-17 21:29:09 +02:00
|
|
|
# Download dependencies
|
2021-02-25 15:38:09 +01:00
|
|
|
COPY ui /app
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
WORKDIR /app
|
|
|
|
RUN npm ci --omit=dev --ignore-scripts \
|
|
|
|
# Build frontend
|
|
|
|
&& npm run build -- --base=$UI_PUBLIC_URL
|
2020-03-01 02:06:18 +01:00
|
|
|
|
2021-01-17 15:59:08 +01:00
|
|
|
### Build API ###
|
2024-06-28 09:10:18 +02:00
|
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22-bookworm AS api
|
2021-03-28 13:57:57 +02:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
2024-06-28 09:10:18 +02:00
|
|
|
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
|
|
|
COPY scripts /tmp/scripts
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
COPY api /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2021-03-31 23:32:37 +02:00
|
|
|
ENV GOPATH="/go"
|
|
|
|
ENV PATH="${GOPATH}/bin:${PATH}"
|
2024-06-28 09:10:18 +02:00
|
|
|
ENV CGO_ENABLED=1
|
2020-08-09 20:32:02 +02:00
|
|
|
|
2020-05-17 21:29:09 +02:00
|
|
|
# Download dependencies
|
2024-06-28 09:10:18 +02:00
|
|
|
RUN chmod +x /tmp/scripts/*.sh \
|
|
|
|
&& /tmp/scripts/install_build_dependencies.sh \
|
|
|
|
&& source /tmp/scripts/set_go_env.sh \
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
&& go env \
|
|
|
|
&& go mod download \
|
|
|
|
# Patch go-face
|
|
|
|
&& sed -i 's/-march=native//g' ${GOPATH}/pkg/mod/github.com/!kagami/go-face*/face.go \
|
|
|
|
# Build dependencies that use CGO
|
|
|
|
&& go install \
|
|
|
|
github.com/mattn/go-sqlite3 \
|
|
|
|
github.com/Kagami/go-face \
|
|
|
|
# Build api source
|
|
|
|
&& go build -v -o photoview .
|
2020-03-01 02:06:18 +01:00
|
|
|
|
2021-01-17 15:59:08 +01:00
|
|
|
### Copy api and ui to production environment ###
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
FROM debian:bookworm-slim
|
2021-03-03 13:32:44 +01:00
|
|
|
ARG TARGETPLATFORM
|
2021-02-22 21:14:15 +01:00
|
|
|
|
2024-05-31 10:34:46 +02:00
|
|
|
# See for details: https://github.com/hadolint/hadolint/wiki/DL4006
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
2024-06-28 09:10:18 +02:00
|
|
|
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
# Create a user to run Photoview server
|
2024-06-23 14:28:02 +02:00
|
|
|
RUN groupadd -g 999 photoview \
|
|
|
|
&& useradd -r -u 999 -g photoview -m photoview \
|
2021-02-25 15:38:09 +01:00
|
|
|
# Required dependencies
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y curl gnupg gpg libdlib19.1 ffmpeg exiftool libheif1 sqlite3 \
|
|
|
|
# Install Darktable if building for a supported architecture
|
|
|
|
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ] || [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
|
|
|
echo 'deb https://download.opensuse.org/repositories/graphics:/darktable/Debian_12/ /' \
|
|
|
|
| tee /etc/apt/sources.list.d/graphics:darktable.list; \
|
|
|
|
curl -fsSL https://download.opensuse.org/repositories/graphics:/darktable/Debian_12/Release.key \
|
|
|
|
| gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null; \
|
|
|
|
apt-get update; \
|
|
|
|
apt-get install -y darktable; \
|
|
|
|
fi \
|
|
|
|
# Remove build dependencies and cleanup
|
|
|
|
&& apt-get purge -y gnupg gpg \
|
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean \
|
2021-03-03 13:32:44 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2020-07-13 18:14:01 +02:00
|
|
|
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
WORKDIR /home/photoview
|
|
|
|
COPY api/data /app/data
|
|
|
|
COPY --from=ui /app/dist /app/ui
|
2020-03-01 02:06:18 +01:00
|
|
|
COPY --from=api /app/photoview /app/photoview
|
|
|
|
|
2024-06-28 09:10:18 +02:00
|
|
|
ENV PHOTOVIEW_LISTEN_IP=127.0.0.1
|
|
|
|
ENV PHOTOVIEW_LISTEN_PORT=80
|
2020-04-30 14:59:29 +02:00
|
|
|
|
2024-06-28 09:10:18 +02:00
|
|
|
ENV PHOTOVIEW_SERVE_UI=1
|
|
|
|
ENV PHOTOVIEW_UI_PATH=/app/ui
|
|
|
|
ENV PHOTOVIEW_FACE_RECOGNITION_MODELS_PATH=/app/data/models
|
|
|
|
ENV PHOTOVIEW_MEDIA_CACHE=/home/photoview/media-cache
|
2020-04-30 14:59:29 +02:00
|
|
|
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
EXPOSE ${PHOTOVIEW_LISTEN_PORT}
|
2020-03-01 02:06:18 +01:00
|
|
|
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
HEALTHCHECK --interval=60s --timeout=10s \
|
|
|
|
CMD curl --fail http://localhost:${PHOTOVIEW_LISTEN_PORT}/api/graphql \
|
|
|
|
-X POST -H 'Content-Type: application/json' \
|
|
|
|
--data-raw '{"operationName":"CheckInitialSetup","variables":{},"query":"query CheckInitialSetup { siteInfo { initialSetup }}"}' \
|
|
|
|
|| exit 1
|
2021-10-02 16:50:24 +02:00
|
|
|
|
Refactor docker deployment and user setup (#863)
* Fix #862, address #826 and maybe some other tickets: reimplemented the docker-compose user setup to enhance product setup experience and cover much more cases.
* make unique DB container name and use it in communication from Photoview
* Removed unnecessary healthcheck for photoview from docker-compose.example.yml, as it is defined in the Dockerfile; optimized Dockerfile combining all RUN directives of PROD stage into 1, which will produce single layer and save some space; added Dockerfile-dev, docker-compose-dev.yml, and new "dev" and "dev-down" directives into Makefile, which allows to setup development env in Docker. Instructions of how to use it are in comments at the beginning of Dockerfile-dev and docker-compose-dev.yml files
* Set RWX permissions to the application's working folder for any user, so that the image could be later run with non-root permissions and the app still be able to do needed operations in the FS
* Enhanced the "Getting started" section in the readme; added the `help` target and enhanced comments in the Makefile; commented out the `docker system prune -f` with the comment about the command and why it is there; added optional and commented by default `7zz` commands to the `backup` section of the Makefile
* Use `slim` base image for final photoview image
* Implement SQLite support according to the PR #851
* Removed deprecated `version` line from compose files; optimized dockerfile to build with less layers and run as non-root; mapped only Photoview related services to Watchtower by default instead of updating all running images on a host; added template for Postgres to the .env; reverted compose executable definition, so the new compose is called when present; added a tip about `lnav` to help
* fix a typo in the username; add support of PostgreSQL; split and optimize backup target in Makefile
* Fixed some typos and styling in Readme, excluded dev-environment setup from the PR; added a list of tips on how to secure Photoview in the Advanced setup section of Readme
* Implemented many security improvements, suggested by @Omar007, switched to the dedicated Darktable's repo to install the latest released version, as asked in #935; switched Watchtower to labels instead of profiles
* forgot the compose file
* move face models back to /app folder; comment out and document unnecessary vars in compose; fix a typo in a few vars
* Exclude Makefile in the root folder from git; documented multiple mounts case better; fixed incorrect SQLite DB path
* Fixed several bugs after complete testing cycle with all 3 DBs
* removed hardcoded port in Dockerfile
* Pin the major version for the `photoview` image for stability
* Revert back to the port 80 inside the container on product owner's request
* Provide a minimal compose file and update the readme accordingly
* Handle incorrect media file and folder permissions; set correct permissions for storage folder; fix healthcheck command for postgres
---------
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-15 10:58:02 +02:00
|
|
|
USER photoview
|
2020-03-01 02:06:18 +01:00
|
|
|
ENTRYPOINT ["/app/photoview"]
|