Skip to content

Instantly share code, notes, and snippets.

@ravamo
Last active November 16, 2021 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravamo/4ba3ad2e5a4ce3bde821490fa3046348 to your computer and use it in GitHub Desktop.
Save ravamo/4ba3ad2e5a4ce3bde821490fa3046348 to your computer and use it in GitHub Desktop.
log
SSL_TYPE=selfsign
#DOMAIN=localhost
DOMAIN=odk.test.org
SYSADMIN_EMAIL=name@dmain.es
version: "3"
services:
postgres:
#image: "postgres:9.6"
image: "postgres:12"
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
POSTGRES_USER: odk
POSTGRES_PASSWORD: odk
POSTGRES_DATABASE: odk
restart: always
mail:
image: "itsissa/namshi-smtp:4.92-8.deb10u6"
volumes:
- ./files/dkim/config:/etc/exim4/_docker_additional_macros:ro
- ./files/dkim/rsa.private:/etc/exim4/domain.key:ro
environment:
- MAILNAME=${DOMAIN}
restart: always
service:
build:
context: .
dockerfile: service.dockerfile
depends_on:
- secrets
- postgres
- mail
- pyxform
- enketo
volumes:
- secrets:/etc/secrets
- /data/transfer:/data/transfer
environment:
- DOMAIN=${DOMAIN}
- SYSADMIN_EMAIL=${SYSADMIN_EMAIL}
command: [ "./wait-for-it.sh", "postgres:5432", "--", "./start-odk.sh" ]
restart: always
logging:
driver: local
nginx:
build:
context: .
dockerfile: nginx.dockerfile
depends_on:
- service
- enketo
environment:
- SSL_TYPE=${SSL_TYPE:-letsencrypt}
- DOMAIN=${DOMAIN}
- CERTBOT_EMAIL=${SYSADMIN_EMAIL}
ports:
- "${HTTP_PORT:-80}:80"
- "${HTTPS_PORT:-443}:443"
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 80 || exit 1" ]
restart: always
logging:
driver: local
options:
max-file: "30"
pyxform:
image: 'ghcr.io/getodk/pyxform-http:v1.7.0'
restart: always
secrets:
volumes:
- secrets:/etc/secrets
build:
context: .
dockerfile: secrets.dockerfile
command: './generate-secrets.sh'
enketo:
volumes:
- secrets:/etc/secrets
build:
context: .
dockerfile: enketo.dockerfile
restart: always
depends_on:
- secrets
- enketo_redis_main
- enketo_redis_cache
environment:
- DOMAIN=${DOMAIN}
- SUPPORT_EMAIL=${SYSADMIN_EMAIL}
extra_hosts:
- 'odk.test.org:10.20.60.102'
enketo_redis_main:
image: redis:5
volumes:
- ./files/enketo/redis-enketo-main.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_main:/data
command:
- redis-server
- /usr/local/etc/redis/redis.conf
restart: always
enketo_redis_cache:
image: redis:5
volumes:
- ./files/enketo/redis-enketo-cache.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_cache:/data
command:
- redis-server
- /usr/local/etc/redis/redis.conf
restart: always
volumes:
transfer:
enketo_redis_main:
enketo_redis_cache:
secrets:
FROM ghcr.io/enketo/enketo-express:3.0.4
ENV ENKETO_SRC_DIR=/srv/src/enketo_express
WORKDIR ${ENKETO_SRC_DIR}
# we copy the config template twice. eventually we do want to actually template
# it for the sake of the running server, and we can't do this until the container
# is actually running (volumes aren't available on image build). but there are
# also some static values that the client needs to see, and it doesn't in turn
# care about anything the server needs. because the client config is baked at
# build time, we therefore hand it the untemplated config.
COPY files/enketo/config.json.template ${ENKETO_SRC_DIR}/config/config.json.template
COPY files/enketo/config.json.template ${ENKETO_SRC_DIR}/config/config.json
COPY files/enketo/start-enketo.sh ${ENKETO_SRC_DIR}/start-enketo.sh
RUN apt-get update; apt-get install gettext-base
RUN npm install
RUN grunt
RUN npm prune --production
EXPOSE 8005
CMD ./start-enketo.sh
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/projects HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/projects HTTP/1.0" 304 -
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/projects HTTP/1.0" 304 -
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/users HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/users HTTP/1.0" 304 -
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:36 +0000] "GET /v1/users HTTP/1.0" 304 -
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2 HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2 HTTP/1.0" 304 -
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2 HTTP/1.0" 304 -
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2/forms HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2/forms HTTP/1.0" 304 -
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:42 +0000] "GET /v1/projects/2/forms HTTP/1.0" 304 -
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey HTTP/1.0" 200 704
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey HTTP/1.0" 200 704
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey HTTP/1.1" 200 704 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft HTTP/1.0" 200 704
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft HTTP/1.0" 200 704
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft HTTP/1.1" 200 704 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/versions HTTP/1.1" 200 2 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/versions HTTP/1.0" 200 2
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/versions HTTP/1.0" 200 2
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft/attachments HTTP/1.1" 200 2 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft/attachments HTTP/1.0" 200 2
service_1 | ::ffff:192.168.224.9 - - [16/Nov/2021:11:57:44 +0000] "GET /v1/projects/2/forms/PDMSurvey/draft/attachments HTTP/1.0" 200 2
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:45 +0000] "GET /version.txt HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF HTTP/1.1" 304 0 "https://odk.test.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/fonts/OpenSans-Bold-webfont.woff HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/fonts/OpenSans-Regular-webfont.woff HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/fonts/fontawesome-webfont.woff?v=4.6.2 HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/js/build/enketo-webform.js HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/css/theme-kobo.css HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:47 +0000] "GET /-/css/theme-kobo.print.css HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:48 +0000] "GET /-/locales/build/en/translation-combined.json HTTP/1.1" 304 0 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
enketo_1 | 11:57:48 0|enketo | (node:62) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
enketo_1 | 11:57:48 0|enketo | (Use `node --trace-warnings ...` to show where the warning was created)
nginx_1 | 10.20.60.102 - - [16/Nov/2021:11:57:48 +0000] "POST /-/transform/xform/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF HTTP/1.1" 500 72 "https://odk.test.org/-/preview/yHwHwb53JWhVxgHgI8dRhBLX2DFmboF" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
enketo_redis_main_1 | 1:M 16 Nov 2021 11:57:48.232 * 1 changes in 300 seconds. Saving...
enketo_redis_main_1 | 1:M 16 Nov 2021 11:57:48.233 * Background saving started by pid 19
enketo_redis_main_1 | 19:C 16 Nov 2021 11:57:48.235 * DB saved on disk
enketo_redis_main_1 | 19:C 16 Nov 2021 11:57:48.236 * RDB: 0 MB of memory used by copy-on-write
enketo_redis_main_1 | 1:M 16 Nov 2021 11:57:48.333 * Background saving terminated with success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment