Dockerfile Expose Example _best_ -

COPY . . EXPOSE 8000/tcp # Main web application EXPOSE 8080/tcp # Admin interface EXPOSE 5432/tcp # Internal database (documentation only) UDP port example EXPOSE 53/udp # DNS service Port range (if supported by your container runtime) EXPOSE 9000-9010/tcp

COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt dockerfile expose example

HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD curl -f http://localhost:8000/health || exit 1 dockerfile expose example

COPY . . EXPOSE 3000

: EXPOSE is metadata. Always use -p or -P when running containers to actually access the ports! dockerfile expose example