Proof-of-concept for running PhotoPrism in Docker
This commit is contained in:
parent
2eb077f826
commit
ad061a1cea
5 changed files with 37 additions and 20 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,8 +3,8 @@
|
|||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
import.zip
|
||||
photoprism
|
||||
/*.zip
|
||||
/photoprism
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
|
15
.travis.yml
15
.travis.yml
|
@ -1,4 +1,13 @@
|
|||
language: go
|
||||
sudo: required
|
||||
|
||||
go:
|
||||
- 1.9
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_script:
|
||||
- docker-compose up --build -d
|
||||
|
||||
script:
|
||||
- docker-compose exec photoprism 'go test'
|
||||
|
||||
after_script:
|
||||
- docker-compose down
|
|
@ -16,21 +16,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
make \
|
||||
pkg-config \
|
||||
wget \
|
||||
darktable \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV GOLANG_VERSION 1.9.1
|
||||
ENV GOLANG_VERSION 1.10
|
||||
RUN set -eux; \
|
||||
\
|
||||
dpkgArch="$(dpkg --print-architecture)"; \
|
||||
case "${dpkgArch##*-}" in \
|
||||
amd64) goRelArch='linux-amd64'; goRelSha256='07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7' ;; \
|
||||
armhf) goRelArch='linux-armv6l'; goRelSha256='65a0495a50c7c240a6487b1170939586332f6c8f3526abdbb9140935b3cff14c' ;; \
|
||||
arm64) goRelArch='linux-arm64'; goRelSha256='d31ecae36efea5197af271ccce86ccc2baf10d2e04f20d0fb75556ecf0614dad' ;; \
|
||||
i386) goRelArch='linux-386'; goRelSha256='2cea1ce9325cb40839601b566bc02b11c92b2942c21110b1b254c7e72e5581e7' ;; \
|
||||
ppc64el) goRelArch='linux-ppc64le'; goRelSha256='de57b6439ce9d4dd8b528599317a35fa1e09d6aa93b0a80e3945018658d963b8' ;; \
|
||||
s390x) goRelArch='linux-s390x'; goRelSha256='9adf03574549db82a72e0d721ef2178ec5e51d1ce4f309b271a2bca4dcf206f6' ;; \
|
||||
*) goRelArch='src'; goRelSha256='a84afc9dc7d64fe0fa84d4d735e2ece23831a22117b50dafc75c1484f1cb550e'; \
|
||||
amd64) goRelArch='linux-amd64'; goRelSha256='b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33' ;; \
|
||||
armhf) goRelArch='linux-armv6l'; goRelSha256='6ff665a9ab61240cf9f11a07e03e6819e452a618a32ea05bbb2c80182f838f4f' ;; \
|
||||
arm64) goRelArch='linux-arm64'; goRelSha256='efb47e5c0e020b180291379ab625c6ec1c2e9e9b289336bc7169e6aa1da43fd8' ;; \
|
||||
i386) goRelArch='linux-386'; goRelSha256='2d26a9f41fd80eeb445cc454c2ba6b3d0db2fc732c53d7d0427a9f605bfc55a1' ;; \
|
||||
ppc64el) goRelArch='linux-ppc64le'; goRelSha256='a1e22e2fbcb3e551e0bf59d0f8aeb4b3f2df86714f09d2acd260c6597c43beee' ;; \
|
||||
s390x) goRelArch='linux-s390x'; goRelSha256='71cde197e50afe17f097f81153edb450f880267699f22453272d184e0f4681d7' ;; \
|
||||
*) goRelArch='src'; goRelSha256='f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24'; \
|
||||
echo >&2; echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; echo >&2 ;; \
|
||||
esac; \
|
||||
\
|
||||
|
@ -67,14 +68,20 @@ RUN mkdir -p /model && \
|
|||
unzip /model/inception.zip -d /model && \
|
||||
chmod -R 777 /model
|
||||
|
||||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
|
||||
RUN mkdir -m 777 /go/pkg/dep
|
||||
|
||||
# Create user
|
||||
RUN adduser --disabled-password --gecos '' api
|
||||
USER api
|
||||
# RUN adduser --disabled-password --gecos '' photoprism
|
||||
# USER photoprism
|
||||
|
||||
# Set up project directory
|
||||
WORKDIR "/go/src/tensorflowapi"
|
||||
WORKDIR "/go/src/photoprism"
|
||||
COPY . .
|
||||
|
||||
RUN dep ensure
|
||||
|
||||
# Install the app
|
||||
RUN go install -v ./...
|
||||
|
|
@ -12,7 +12,7 @@ PhotoPrism: Long-Term Digital Photo Archiving
|
|||
[license]: https://github.com/photoprism/photoprism/blob/master/LICENSE
|
||||
|
||||
PhotoPrism is a free tool for importing, filtering and archiving large amounts of
|
||||
JPEG and RAW photos. Originals, thumbnails and metadata are stored in the file system for easy
|
||||
JPEG and RAW files. Originals, thumbnails and metadata are stored in the file system for easy
|
||||
backup and reliable long-term accessibility.
|
||||
|
||||
**Note: This software is still pre-alpha and under active development.
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
version: '3.3'
|
||||
|
||||
services:
|
||||
tensorflowapi:
|
||||
build: './cmd/tensorflowapi'
|
||||
photoprism:
|
||||
build: .
|
||||
ports:
|
||||
- 80:80
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- './cmd/tensorflowapi:/go/src/tensorflowapi'
|
||||
- .:/go/src/photoprism
|
||||
database:
|
||||
image: mysql:latest
|
||||
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024
|
||||
|
|
Loading…
Reference in a new issue