Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

626
Views
Cómo servir archivos estáticos usando Traefik y Nginx en docker-compose

Estoy tratando de servir archivos estáticos usando Traefik y Nginx, también docker. Mi aplicación Django funciona bien, puedo acceder a todas las páginas, pero no puedo configurar el servicio de archivos estáticos. Cuando abro site.url/staic/ Me redirige a la página 404. Para el esqueleto del código, estoy usando cookiecutter-django.

Aquí está la configuración de mi ventana acoplable:

 django: build: context: . dockerfile: ./compose/production/django/Dockerfile image: dreamway_team_production_django depends_on: - postgres - redis env_file: - ./.envs/.production/.django - ./.envs/.production/.postgres command: /start postgres: ** traefik: build: context: . dockerfile: ./compose/production/traefik/Dockerfile image: dreamway_team_production_traefik depends_on: - django - nginx volumes: - production_traefik:/etc/traefik/acme ports: - "0.0.0.0:80:80" - "0.0.0.0:443:443" redis: ** nginx: image: nginx:1.17.4 depends_on: - django volumes: - ./config/nginx.conf:/etc/nginx/conf.d/default.conf - ./dreamway_team/static:/static

y mi configuración para traefik:

 log: level: INFO entryPoints: web: address: ":80" web-secure: address: ":443" certificatesResolvers: letsencrypt: acme: email: "mail" storage: /etc/traefik/acme/acme.json httpChallenge: entryPoint: web http: routers: web-router: rule: "Host(`[DOMAIN_NAME]`)" entryPoints: - web middlewares: - redirect - csrf service: django web-secure-router: rule: "Host(`[DOMAIN_NAME]`)" entryPoints: - web-secure middlewares: - csrf service: django tls: certResolver: letsencrypt middlewares: redirect: redirectScheme: scheme: https permanent: true csrf: headers: hostsProxyHeaders: ["X-CSRFToken"] services: django: loadBalancer: servers: - url: http://django:5000 providers: file: filename: /etc/traefik/traefik.yml watch: true

¡Cualquier ayuda sería apreciada! ¡Gracias!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!