Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to set worker processes by environment variable #1953

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions docker/Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ RUN addgroup -g 61000 doccano \
&& adduser -G doccano -S doccano -u 61000

COPY --chown=doccano:doccano --from=frontend-builder /app/dist /var/www/html
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/nginx.conf.template /etc/nginx/nginx.conf.template
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf

RUN chown -R doccano:doccano /var/cache/nginx \
&& chmod -R g+w /var/cache/nginx \
&& chown -R doccano:doccano /media
&& chown -R doccano:doccano /media \
&& chown -R doccano:doccano /etc/nginx

EXPOSE 8080

Expand Down
8 changes: 8 additions & 0 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ services:
context: ..
dockerfile: docker/Dockerfile.nginx
image: doccano_nginx:prod
command: >
/bin/sh -c
"envsubst '
$${WORKER_PROCESSES}
'< /etc/nginx/nginx.conf.template
> /etc/nginx/nginx.conf
&& nginx -g 'daemon off;'"
environment:
API_URL: "http://backend:8000"
GOOGLE_TRACKING_ID: ""
WORKER_PROCESSES: "auto"
volumes:
- static_volume:/static
- media:/media
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
worker_processes auto;
worker_processes ${WORKER_PROCESSES};

error_log /var/log/nginx/error.log warn;

Expand Down