forked from jarun/buku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(docker): add healthcheck to container Signed-off-by: Ameya Shenoy <[email protected]> * feat(docker): add docker-compose files Signed-off-by: Ameya Shenoy <[email protected]>
- Loading branch information
1 parent
ef2dd19
commit 4e13df9
Showing
4 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ FROM python:alpine | |
|
||
MAINTAINER Ameya Shenoy "[email protected]" | ||
|
||
ENV BUKUSERVER_PORT=5001 | ||
|
||
COPY . /Buku | ||
|
||
RUN set -ex \ | ||
|
@@ -17,6 +19,9 @@ RUN set -ex \ | |
&& apk del .build-deps \ | ||
&& rm -rf /Buku | ||
|
||
ENTRYPOINT gunicorn --bind 0.0.0.0:5001 "bukuserver.server:create_app()" | ||
EXPOSE 5001 | ||
HEALTHCHECK --interval=1m --timeout=10s \ | ||
CMD nc -z localhost ${BUKUSERVER_PORT} || exit 1 | ||
|
||
ENTRYPOINT gunicorn --bind 0.0.0.0:${BUKUSERVER_PORT} "bukuserver.server:create_app()" | ||
EXPOSE ${BUKUSERVER_PORT} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
server { | ||
listen 80; | ||
server_name yoursitename.com; | ||
server_tokens off; | ||
|
||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
|
||
location / { | ||
#auth_basic "Administrator's Area"; | ||
#auth_basic_user_file /basic_auth/.htpasswd; | ||
proxy_pass http://bukuserver:5001; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Remote-Port $remote_port; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_redirect off; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.7' | ||
|
||
services: | ||
bukuserver: | ||
image: bukuserver/bukuserver | ||
restart: unless-stopped | ||
environment: | ||
- BUKUSERVER_PER_PAGE=100 | ||
- BUKUSERVER_OPEN_IN_NEW_TAB=true | ||
# - BUKUSERVER_SECRET_KEY=123456789012345678901234 | ||
# - BUKUSERVER_URL_RENDER_MODE=full | ||
# - BUKUSERVER_DISABLE_FAVICON=false | ||
ports: | ||
- "5001:5001" | ||
volumes: | ||
- ./data:/root/.local/share/buku | ||
|
||
nginx: | ||
image: nginx:alpine | ||
restart: unless-stopped | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./data/nginx:/etc/nginx/conf.d | ||
- ./data/basic_auth:/basic_auth | ||
|