mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-01-10 04:07:35 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7571788bc7
@ -83,7 +83,7 @@ If you want to run the container by yourself, here you go:
|
|||||||
docker run \
|
docker run \
|
||||||
-p 80:80 \
|
-p 80:80 \
|
||||||
-e NODE_ENV=production \
|
-e NODE_ENV=production \
|
||||||
-v <path to your config file folder>/config.json:/app/data/config/config.json \
|
-v <path to your config file folder>:/app/data/config \
|
||||||
-v <path to your db file folder>:/app/data/db \
|
-v <path to your db file folder>:/app/data/db \
|
||||||
-v <path to your images folder>:/app/data/images \
|
-v <path to your images folder>:/app/data/images \
|
||||||
-v <path to your temp folder>:/app/data/tmp \
|
-v <path to your temp folder>:/app/data/tmp \
|
||||||
|
@ -14,7 +14,7 @@ RUN mkdir -p /app/data/config && \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:12-alpine3.11 as main
|
FROM node:12-alpine3.11 AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
@ -24,7 +24,6 @@ ENV NODE_ENV=production \
|
|||||||
# flagging dockerized environemnt
|
# flagging dockerized environemnt
|
||||||
PI_DOCKER=true
|
PI_DOCKER=true
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.11/community/ \
|
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.11/community/ \
|
||||||
vips ffmpeg
|
vips ffmpeg
|
||||||
@ -34,7 +33,6 @@ HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
|
|||||||
CMD wget --quiet --tries=1 --no-check-certificate --spider \
|
CMD wget --quiet --tries=1 --no-check-certificate --spider \
|
||||||
http://localhost:80/heartbeat || exit 1
|
http://localhost:80/heartbeat || exit 1
|
||||||
|
|
||||||
|
|
||||||
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
|
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
|
||||||
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
|
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
|
||||||
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
|
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
|
||||||
|
@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \
|
|||||||
|
|
||||||
#-----------------MAIN--------------------
|
#-----------------MAIN--------------------
|
||||||
#-----------------------------------------
|
#-----------------------------------------
|
||||||
FROM node:12-stretch-slim as main
|
FROM node:12-stretch-slim AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
@ -22,14 +22,11 @@ ENV NODE_ENV=production \
|
|||||||
# flagging dockerized environemnt
|
# flagging dockerized environemnt
|
||||||
PI_DOCKER=true
|
PI_DOCKER=true
|
||||||
|
|
||||||
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
|
|
||||||
# This trick is needed as entrypoint in exec form does not support ENV variables
|
|
||||||
# and in shell form ENV variables were not properly passed to pigallry2
|
|
||||||
#RUN echo -e '#!/bin/bash \n node ./src/backend/index --expose-gc --config-path=${CONFIG_FILE}' > ./entrypoint.sh && \
|
|
||||||
# chmod +x ./entrypoint.sh
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
RUN apt-get update && apt-get install -y ffmpeg
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg \
|
||||||
|
&& apt-get clean -q -y \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=builder /app /app
|
COPY --from=builder /app /app
|
||||||
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
|
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
|
||||||
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
|
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
|
||||||
|
@ -1,32 +1,43 @@
|
|||||||
FROM node:12-stretch AS BUILDER
|
#-----------------BUILDER-----------------
|
||||||
|
#-----------------------------------------
|
||||||
|
FROM node:12-stretch AS builder
|
||||||
# LABEL maintainer="Patrik J. Braun"
|
# LABEL maintainer="Patrik J. Braun"
|
||||||
# copying only package{-lock}.json to make node_modules cachable
|
# copying only package{-lock}.json to make node_modules cachable
|
||||||
RUN git clone https://github.com/bpatrik/pigallery2.git /build
|
RUN git clone https://github.com/bpatrik/pigallery2.git /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
RUN set -x && npm install --unsafe-perm && \
|
RUN npm install --unsafe-perm \
|
||||||
mkdir -p /build/release/data/config && \
|
&& mkdir -p /build/release/data/config \
|
||||||
mkdir -p /build/release/data/db && \
|
&& mkdir -p /build/release/data/db \
|
||||||
mkdir -p /build/release/data/images && \
|
&& mkdir -p /build/release/data/images \
|
||||||
mkdir -p /build/release/data/tmp && \
|
&& mkdir -p /build/release/data/tmp \
|
||||||
npm run create-release && \
|
&& npm run create-release \
|
||||||
cd /build/release && npm install --unsafe-perm
|
&& cd /build/release \
|
||||||
|
&& npm install --unsafe-perm
|
||||||
|
|
||||||
|
#-----------------MAIN--------------------
|
||||||
FROM node:12-stretch-slim
|
#-----------------------------------------
|
||||||
|
FROM node:12-stretch-slim AS main
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
CONFIG_FILE=/app/data/config/config.json \
|
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
|
||||||
Server-Database-dbFolder=/app/data/db \
|
default-Server-Database-dbFolder=/app/data/db \
|
||||||
Server-Media-folder=/app/data/images \
|
default-Server-Media-folder=/app/data/images \
|
||||||
Server-Media-tempFolder=/app/data/tmp
|
default-Server-Media-tempFolder=/app/data/tmp \
|
||||||
ENTRYPOINT ["npm", "start", "--", \
|
# flagging dockerized environemnt
|
||||||
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
|
PI_DOCKER=true
|
||||||
"--expose-gc", \
|
|
||||||
"--config-path=$CONFIG_FILE"]
|
EXPOSE 80
|
||||||
EXPOSE 80
|
RUN apt-get update \
|
||||||
COPY --from=BUILDER /build/release /app
|
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg \
|
||||||
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
|
&& apt-get clean -q -y \
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --retries=4 --start-period=60s \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
CMD wget --quiet --tries=1 --no-check-certificate --spider \
|
COPY --from=builder /build/release /app
|
||||||
http://localhost:80 || exit 1
|
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
|
||||||
|
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
|
||||||
|
CMD wget --quiet --tries=1 --no-check-certificate --spider \
|
||||||
|
http://localhost:80/heartbeat || exit 1
|
||||||
|
|
||||||
|
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
|
||||||
|
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
|
||||||
|
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ services:
|
|||||||
|
|
||||||
pigallery2:
|
pigallery2:
|
||||||
image: bpatrik/pigallery2:latest
|
image: bpatrik/pigallery2:latest
|
||||||
command: sh -c 'bin/wait-for pigallery-db:3306 -- --Server-Database-mysql-host=pigallery-db --Server-Database-mysql-username=pigallery2 --Server-Database-mysql-password=pigallery2_pass--Server-Database-mysql-database=pigallery2'
|
command: sh -c 'bin/wait-for pigallery-db:3306 -- --Server-Database-mysql-host=pigallery-db --Server-Database-mysql-username=pigallery2 --Server-Database-mysql-password=pigallery2_pass --Server-Database-mysql-database=pigallery2'
|
||||||
container_name: pigallery2
|
container_name: pigallery2
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
|
@ -13,13 +13,13 @@ export class MapService {
|
|||||||
|
|
||||||
constructor(private networkService: NetworkService) {
|
constructor(private networkService: NetworkService) {
|
||||||
MapService.MAPBOXLAYERS = [{
|
MapService.MAPBOXLAYERS = [{
|
||||||
name: 'street', url: 'https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token='
|
name: 'street', url: 'https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/256/{z}/{x}/{y}?access_token='
|
||||||
+ Config.Client.Map.mapboxAccessToken
|
+ Config.Client.Map.mapboxAccessToken
|
||||||
}, {
|
}, {
|
||||||
name: 'satellite', url: 'https://api.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token='
|
name: 'satellite', url: 'https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token='
|
||||||
+ Config.Client.Map.mapboxAccessToken
|
+ Config.Client.Map.mapboxAccessToken
|
||||||
}, {
|
}, {
|
||||||
name: 'hybrid', url: 'https://api.tiles.mapbox.com/v4/mapbox.streets-satellite/{z}/{x}/{y}.png?access_token='
|
name: 'hybrid', url: 'https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/256/{z}/{x}/{y}?access_token='
|
||||||
+ Config.Client.Map.mapboxAccessToken
|
+ Config.Client.Map.mapboxAccessToken
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user